• jass脚本调了一个下午


    globals
        boolean isDebug=true

        unit mHero = null 

        constant integer SMART=851971   //右键单击
        constant integer STOP=851972    //停止
        constant integer ATTACK=851983  //攻击
        constant integer ATTACKGROUND=851984    //攻击地面
        constant integer MOVE=851986   //移动
        constant integer PATROL=851990 //巡逻
        constant integer HOLD=851993   //保持原位

    endglobals
    function printf takes string msg returns nothing
        if isDebug then
            call DisplayTextToPlayer(GetLocalPlayer(),0,0,msg)
        endif
    endfunction

    function selectHero takes nothing returns unit
        local unit u = null
        local group g = CreateGroup()
        call GroupEnumUnitsOfPlayer(g,ai_player,null)
        loop
            set u = FirstOfGroup(g)
            exitwhen u==null
            if IsUnitType(u,UNIT_TYPE_HERO) and not IsUnitIllusion(u) then
                return u
            endif
            call GroupRemoveUnit(g,u)
        endloop
        call RemoveUnit(u)
        set u=null
        return null
    endfunction
    //为玩家2创建守鹤
    function CreateUnitById takes player playerId,integer unitId returns nothing
        call CreateUnit(playerId,unitId,3600,3300,90)
    endfunction
    function  gotoRandomLoc takes nothing returns nothing
        local location loc = null
        loop
            set mHero = selectHero()
            exitwhen mHero==null
            set loc = Location(GetRandomReal(-4000,4000),GetRandomReal(-4000,4000))

            call Sleep(10)    

            call IssuePointOrderByIdLoc(mHero,'attack',loc) //这边出错,因为没定义attack  ---851983

            call RemoveLocation(loc)
            set loc = null
        endloop
    endfunction
    function main takes nothing returns nothing
        call printf("Init AI>>>")
        call InitAI()//初始化AI
        call Sleep(10)
        call CreateUnitById(ai_player,'H002')
        call Sleep(1.0)
        call selectHero()
        call StartThread(function gotoRandomLoc)
    endfunction
  • 相关阅读:
    在线古书式竖排工具
    智能实验室-全能优化(Guardio) 5.04.0.1040
    智能实验室-全能优化(Guardio) 5.03.0.1011
    在线专用链双向转换
    智能实验室-杀马(Defendio) 4.32.0.1020
    智能实验室-杀马(Defendio) 4.31.0.1010
    智能实验室-全能优化(Guardio) 4.999.0.981
    智能实验室-杀马(Defendio) 4.27.0.951
    智能实验室-全能优化(Guardio) 5.02.0.1000
    智能实验室-结构化存储浏览器(SSExplorer) 2.0.0.200
  • 原文地址:https://www.cnblogs.com/IntelligentBrain/p/5111323.html
Copyright © 2020-2023  润新知