Lua CMDs: Difference between revisions

From Spring
Jump to navigationJump to search
JK (talk | contribs)
test
JK (talk | contribs)
added local links
Line 1: Line 1:
== Options ==
== Options ==
'''CMD.OPT_ALT'''<br>
<b id=CMD.OPT_ALT>CMD.OPT_ALT</b><br>
'''CMD.OPT_CTRL'''<br>
<b id=CMD.OPT_CTRL>CMD.OPT_CTRL</b><br>
'''CMD.OPT_SHIFT'''<br>
<b id=CMD.OPT_SHIFT>CMD.OPT_SHIFT</b><br>
'''CMD.OPT_RIGHT'''<br>
<b id=CMD.OPT_RIGHT>CMD.OPT_RIGHT</b><br>
'''CMD.OPT_INTERNAL'''
<b id=CMD.OPT_INTERNAL>CMD.OPT_INTERNAL</b>


== Waitcodes ==
== Waitcodes ==
'''CMD.WAITCODE_TIME'''<br>
<b id=CMD.WAITCODE_TIME>CMD.WAITCODE_TIME</b><br>
'''CMD.WAITCODE_DEATH'''<br>
<b id=CMD.WAITCODE_DEATH>CMD.WAITCODE_DEATH</b><br>
'''CMD.WAITCODE_SQUAD'''<br>
<b id=CMD.WAITCODE_SQUAD>CMD.WAITCODE_SQUAD</b><br>
'''CMD.WAITCODE_GATHER'''
<b id=CMD.WAITCODE_GATHER>CMD.WAITCODE_GATHER</b>


== Insert/Remove Commands ==
== Insert/Remove Commands ==
Line 22: Line 22:
   end</font>
   end</font>


'''CMD.INSERT'''
<b id=CMD.INSERT>CMD.INSERT</b>
   options.ALT    -> treat param0 as a position instead of a tag  
   options.ALT    -> treat param0 as a position instead of a tag  
   options.CONTROL -> use the build queue for factories  
   options.CONTROL -> use the build queue for factories  
Line 43: Line 43:
         You have to use CMD.OPT_* in this case.
         You have to use CMD.OPT_* in this case.
   </font>
   </font>
'''CMD.REMOVE'''
<b id=CMD.REMOVE>CMD.REMOVE</b>
   options.ALT    -> use the parameters as commandIDs  
   options.ALT    -> use the parameters as commandIDs  
   options.CONTROL -> use the build queue for factories  
   options.CONTROL -> use the build queue for factories  
Line 51: Line 51:
<font color="darkgreen">Note, the CMD[] table is bidirectional. That means: CMD[CMD.STOP] := "CMD_STOP"</font>
<font color="darkgreen">Note, the CMD[] table is bidirectional. That means: CMD[CMD.STOP] := "CMD_STOP"</font>


'''CMD.STOP'''
<b id=CMD.STOP>CMD.STOP</b>
   type CMDTYPE.ICON
   type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]
'''CMD.WAIT'''
<b id=CMD.WAIT>CMD.WAIT</b>
   type CMDTYPE.ICON
   type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]
'''CMD.TIMEWAIT'''
<b id=CMD.TIMEWAIT>CMD.TIMEWAIT</b>
   type CMDTYPE.NUMBER
   type [[Lua_CMDs#CMDTYPE.NUMBER|CMDTYPE.NUMBER]]
'''CMD.DEATHWAIT'''
<b id=CMD.DEATHWAIT>CMD.DEATHWAIT</b>
   type CMDTYPE.ICON_UNIT_OR_RECTANGLE
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_RECTANGLE|CMDTYPE.ICON_UNIT_OR_RECTANGLE]]
'''CMD.SQUADWAIT'''
<b id=CMD.SQUADWAIT>CMD.SQUADWAIT</b>
   type CMDTYPE.NUMBER
   type [[Lua_CMDs#CMDTYPE.NUMBER|CMDTYPE.NUMBER]]
'''CMD.GATHERWAIT'''
<b id=CMD.GATHERWAIT>CMD.GATHERWAIT</b>
   type CMDTYPE.ICON
   type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]
'''CMD.MOVE'''
<b id=CMD.MOVE>CMD.MOVE</b>
   type CMDTYPE.ICON_MAP
   type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]
'''CMD.PATROL'''
<b id=CMD.PATROL>CMD.PATROL</b>
   type CMDTYPE.ICON_MAP
   type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]
'''CMD.FIGHT'''
<b id=CMD.FIGHT>CMD.FIGHT</b>
   type CMDTYPE.ICON_MAP
   type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]
'''CMD.ATTACK'''
<b id=CMD.ATTACK>CMD.ATTACK</b>
   type CMDTYPE.ICON_UNIT_OR_MAP
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_MAP|CMDTYPE.ICON_UNIT_OR_MAP]]
'''CMD.AREA_ATTACK'''
<b id=CMD.AREA_ATTACK>CMD.AREA_ATTACK</b>
   type CMDTYPE.ICON_AREA
   type [[Lua_CMDs#CMDTYPE.ICON_AREA|CMDTYPE.ICON_AREA]]
'''CMD.GUARD'''
<b id=CMD.GUARD>CMD.GUARD</b>
   type CMDTYPE.ICON_UNIT
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT|CMDTYPE.ICON_UNIT]]
'''CMD.AISELECT'''
<b id=CMD.AISELECT>CMD.AISELECT</b>
   type CMDTYPE.COMBO_BOX
   type [[Lua_CMDs#CMDTYPE.COMBO_BOX|CMDTYPE.COMBO_BOX]]
'''CMD.GROUPSELECT'''
<b id=CMD.GROUPSELECT>CMD.GROUPSELECT</b>
   type CMDTYPE.ICON
   type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]
'''CMD.GROUPADD'''
<b id=CMD.GROUPADD>CMD.GROUPADD</b>
   type CMDTYPE.ICON
   type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]
'''CMD.GROUPCLEAR'''
<b id=CMD.GROUPCLEAR>CMD.GROUPCLEAR</b>
   type CMDTYPE.ICON
   type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]
'''CMD.REPAIR'''
<b id=CMD.REPAIR>CMD.REPAIR</b>
   type CMDTYPE.ICON_UNIT_OR_AREA
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]
'''CMD.FIRE_STATE'''
<b id=CMD.FIRE_STATE>CMD.FIRE_STATE</b>
   type CMDTYPE.ICON_MODE
   type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]
'''CMD.MOVE_STATE'''
<b id=CMD.MOVE_STATE>CMD.MOVE_STATE</b>
   type CMDTYPE.ICON_MODE
   type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]
'''CMD.SELFD'''
<b id=CMD.SELFD>CMD.SELFD</b>
   type CMDTYPE.ICON
   type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]
'''CMD.LOAD_UNITS'''
<b id=CMD.LOAD_UNITS>CMD.LOAD_UNITS</b>
   type CMDTYPE.ICON_UNIT_OR_AREA
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]
'''CMD.LOAD_ONTO'''
<b id=CMD.LOAD_ONTO>CMD.LOAD_ONTO</b>
   type CMDTYPE.ICON_UNIT
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT|CMDTYPE.ICON_UNIT]]
'''CMD.UNLOAD_UNITS'''
<b id=CMD.UNLOAD_UNITS>CMD.UNLOAD_UNITS</b>
   type CMDTYPE.ICON_UNIT_OR_AREA
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]
'''CMD.UNLOAD_UNIT'''
<b id=CMD.UNLOAD_UNIT>CMD.UNLOAD_UNIT</b>
   type CMDTYPE.ICON_MAP
   type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]
'''CMD.ONOFF'''
<b id=CMD.ONOFF>CMD.ONOFF</b>
   type CMDTYPE.ICON_MODE
   type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]
'''CMD.RECLAIM'''
<b id=CMD.RECLAIM>CMD.RECLAIM</b>
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT_FEATURE_OR_AREA|CMDTYPE.ICON_UNIT_FEATURE_OR_AREA]]
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT_FEATURE_OR_AREA|CMDTYPE.ICON_UNIT_FEATURE_OR_AREA]]
'''CMD.CLOAK'''
<b id=CMD.CLOAK>CMD.CLOAK</b>
   type CMDTYPE.ICON_MODE
   type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]
'''CMD.STOCKPILE'''
<b id=CMD.STOCKPILE>CMD.STOCKPILE</b>
   type CMDTYPE.ICON
   type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]
'''CMD.DGUN'''
<b id=CMD.DGUN>CMD.DGUN</b>
   type CMDTYPE.ICON_MAP
   type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]
'''CMD.RESTORE'''
<b id=CMD.RESTORE>CMD.RESTORE</b>
   type CMDTYPE.ICON_AREA
   type [[Lua_CMDs#CMDTYPE.ICON_AREA|CMDTYPE.ICON_AREA]]
'''CMD.REPEAT'''
<b id=CMD.REPEAT>CMD.REPEAT</b>
   type CMDTYPE.ICON_MODE
   type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]
'''CMD.TRAJECTORY'''
<b id=CMD.TRAJECTORY>CMD.TRAJECTORY</b>
   type CMDTYPE.ICON_MODE
   type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]
'''CMD.RESURRECT'''
<b id=CMD.RESURRECT>CMD.RESURRECT</b>
   type CMDTYPE.ICON_UNIT_FEATURE_OR_AREA
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT_FEATURE_OR_AREA|CMDTYPE.ICON_UNIT_FEATURE_OR_AREA]]
'''CMD.CAPTURE'''
<b id=CMD.CAPTURE>CMD.CAPTURE</b>
   type CMDTYPE.ICON_UNIT_OR_AREA
   type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]
'''CMD.AUTOREPAIRLEVEL'''
<b id=CMD.AUTOREPAIRLEVEL>CMD.AUTOREPAIRLEVEL</b>
   type CMDTYPE.ICON_MODE
   type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]
'''CMD.LOOPBACKATTACK'''
<b id=CMD.LOOPBACKATTACK>CMD.LOOPBACKATTACK</b>
   type CMDTYPE.ICON_MODE
   type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]
'''CMD.IDLEMODE'''
<b id=CMD.IDLEMODE>CMD.IDLEMODE</b>
   type CMDTYPE.ICON_MODE
   type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]
'''CMD.SET_WANTED_MAX_SPEED'''
<b id=CMD.SET_WANTED_MAX_SPEED>CMD.SET_WANTED_MAX_SPEED</b>
   type CMDTYPE.NUMBER
   type [[Lua_CMDs#CMDTYPE.NUMBER|CMDTYPE.NUMBER]]
'''CMD.SETBASE'''
<b id=CMD.SETBASE>CMD.SETBASE</b>


'''CMD.INTERNAL'''
<b id=CMD.INTERNAL>CMD.INTERNAL</b>
   used in different ways
   used in different ways


Line 135: Line 135:
<font color="darkgreen">Note, the CMDTYPE[] table is bidirectional. That means: CMDTYPE[CMDTYPE.ICON] := "CMDTYPE_ICON"</font>
<font color="darkgreen">Note, the CMDTYPE[] table is bidirectional. That means: CMDTYPE[CMDTYPE.ICON] := "CMDTYPE_ICON"</font>


'''CMDTYPE.ICON'''
<b id=CMDTYPE.ICON>CMDTYPE.ICON</b>
   expect 0 parameters in return
   expect 0 parameters in return
'''CMDTYPE.ICON_MODE'''
<b id=CMDTYPE.ICON_MODE>CMDTYPE.ICON_MODE</b>
   expect 1 parameter in return (number selected mode)
   expect 1 parameter in return (number selected mode)
'''CMDTYPE.ICON_MAP'''
<b id=CMDTYPE.ICON_MAP>CMDTYPE.ICON_MAP</b>
   expect 3 parameters in return (mappos)
   expect 3 parameters in return (mappos)
'''CMDTYPE.ICON_AREA'''
<b id=CMDTYPE.ICON_AREA>CMDTYPE.ICON_AREA</b>
   expect 4 parameters in return (mappos+radius)
   expect 4 parameters in return (mappos+radius)
'''CMDTYPE.ICON_UNIT'''
<b id=CMDTYPE.ICON_UNIT>CMDTYPE.ICON_UNIT</b>
   expect 1 parameters in return (unitid)
   expect 1 parameters in return (unitid)
'''CMDTYPE.ICON_UNIT_OR_MAP'''
<b id=CMDTYPE.ICON_UNIT_OR_MAP>CMDTYPE.ICON_UNIT_OR_MAP</b>
   expect 1 parameters in return (unitid) or 3 parameters in return (mappos)
   expect 1 parameters in return (unitid) or 3 parameters in return (mappos)
'''CMDTYPE.ICON_FRONT'''
<b id=CMDTYPE.ICON_FRONT>CMDTYPE.ICON_FRONT</b>
   expect 3 or 6 parameters in return (middle and right side of front if a front was defined)
   expect 3 or 6 parameters in return (middle and right side of front if a front was defined)
'''CMDTYPE.COMBO_BOX'''
<b id=CMDTYPE.COMBO_BOX>CMDTYPE.COMBO_BOX</b>
   expect 1 parameter in return (number selected option)
   expect 1 parameter in return (number selected option)
'''CMDTYPE.ICON_UNIT_OR_AREA'''
<b id=CMDTYPE.ICON_UNIT_OR_AREA>CMDTYPE.ICON_UNIT_OR_AREA</b>
   expect 1 parameter in return (unitid) or 4 parameters in return (mappos+radius)
   expect 1 parameter in return (unitid) or 4 parameters in return (mappos+radius)
<b id=CMDTYPE.ICON_UNIT_FEATURE_OR_AREA>CMDTYPE.ICON_UNIT_FEATURE_OR_AREA</b>
<b id=CMDTYPE.ICON_UNIT_FEATURE_OR_AREA>CMDTYPE.ICON_UNIT_FEATURE_OR_AREA</b>
   expect 1 parameter in return (unitid or [[Lua_ConstGame#Engine|Game.maxUnits]]+featureid)
   expect 1 parameter in return (unitid or [[Lua_ConstGame#Engine|Game.maxUnits]]+featureid)
       or 4 parameters in return (mappos+radius)
       or 4 parameters in return (mappos+radius)
'''CMDTYPE.ICON_BUILDING'''
<b id=CMDTYPE.ICON_BUILDING>CMDTYPE.ICON_BUILDING</b>
   expect 3 parameters in return (mappos)
   expect 3 parameters in return (mappos)
'''CMDTYPE.ICON_UNIT_OR_RECTANGLE'''
<b id=CMDTYPE.ICON_UNIT_OR_RECTANGLE>CMDTYPE.ICON_UNIT_OR_RECTANGLE</b>
   expect 1 parameter in return (unitid)
   expect 1 parameter in return (unitid)
       or 3 parameters in return (mappos)
       or 3 parameters in return (mappos)
       or 6 parameters in return (startpos+endpos)
       or 6 parameters in return (startpos+endpos)
'''CMDTYPE.NUMBER'''
<b id=CMDTYPE.NUMBER>CMDTYPE.NUMBER</b>
   expect 1 parameter in return (number)
   expect 1 parameter in return (number)


'''CMDTYPE.CUSTOM'''
<b id=CMDTYPE.CUSTOM>CMDTYPE.CUSTOM</b>
   used with CMD_INTERNAL
   used with CMD_INTERNAL
'''CMDTYPE.NEXT''' <font color="darkgreen">next command page</font>
<b id=CMDTYPE.NEXT>CMDTYPE.NEXT</b> <font color="darkgreen">next command page</font>
   used with CMD_INTERNAL
   used with CMD_INTERNAL
'''CMDTYPE.PREV''' <font color="darkgreen">previous command page</font>
<b id=CMDTYPE.PREV>CMDTYPE.PREV</b> <font color="darkgreen">previous command page</font>
   used with CMD_INTERNAL
   used with CMD_INTERNAL

Revision as of 02:39, 15 August 2008

Options

CMD.OPT_ALT
CMD.OPT_CTRL
CMD.OPT_SHIFT
CMD.OPT_RIGHT
CMD.OPT_INTERNAL

Waitcodes

CMD.WAITCODE_TIME
CMD.WAITCODE_DEATH
CMD.WAITCODE_SQUAD
CMD.WAITCODE_GATHER

Insert/Remove Commands

First, said "tags" are unique command identifiers, so each command that gets inserted into a unit's command queue gets its unique "tag" number. (It is used to sync command queue operations, also it makes things much easier.)
To receive those "tags" you can do the following:

  local cmdQueue = Spring.GetUnitCommands(unitID);
  if (#cmdQueue>0) then 
     local cmdTag = cmdQueue[1].tag
     ..
  end

CMD.INSERT

 options.ALT     -> treat param0 as a position instead of a tag 
 options.CONTROL -> use the build queue for factories 
 params[0] = command tag or position (negative numbers to reference the back of the queue)
 params[1] = insertCmd id 
 params[2] = insertCmd options (shift,alt,right click,etc.)
 params[3 ... N+2] = insertCmd params[0 ... N-1]
 example:
   Spring.GiveOrderToUnit(unitID,
     CMD.INSERT,
     {-1,CMD.ATTACK,CMD.OPT_SHIFT,unitID2},
     {"alt"}
   );
 
 Note: If you didn't already notice, the command params and
       the command options are twisted in the array (compared to GiverOrder)!
 
 Note2: The command options in the array/table is a number value!
        You have to use CMD.OPT_* in this case.
 

CMD.REMOVE

 options.ALT     -> use the parameters as commandIDs 
 options.CONTROL -> use the build queue for factories 
 params[0 ... N-1] = tags or commandIDs to remove

Commands

Note, the CMD[] table is bidirectional. That means: CMD[CMD.STOP] := "CMD_STOP"

CMD.STOP

 type CMDTYPE.ICON

CMD.WAIT

 type CMDTYPE.ICON

CMD.TIMEWAIT

 type CMDTYPE.NUMBER

CMD.DEATHWAIT

 type CMDTYPE.ICON_UNIT_OR_RECTANGLE

CMD.SQUADWAIT

 type CMDTYPE.NUMBER

CMD.GATHERWAIT

 type CMDTYPE.ICON

CMD.MOVE

 type CMDTYPE.ICON_MAP

CMD.PATROL

 type CMDTYPE.ICON_MAP

CMD.FIGHT

 type CMDTYPE.ICON_MAP

CMD.ATTACK

 type CMDTYPE.ICON_UNIT_OR_MAP

CMD.AREA_ATTACK

 type CMDTYPE.ICON_AREA

CMD.GUARD

 type CMDTYPE.ICON_UNIT

CMD.AISELECT

 type CMDTYPE.COMBO_BOX

CMD.GROUPSELECT

 type CMDTYPE.ICON

CMD.GROUPADD

 type CMDTYPE.ICON

CMD.GROUPCLEAR

 type CMDTYPE.ICON

CMD.REPAIR

 type CMDTYPE.ICON_UNIT_OR_AREA

CMD.FIRE_STATE

 type CMDTYPE.ICON_MODE

CMD.MOVE_STATE

 type CMDTYPE.ICON_MODE

CMD.SELFD

 type CMDTYPE.ICON

CMD.LOAD_UNITS

 type CMDTYPE.ICON_UNIT_OR_AREA

CMD.LOAD_ONTO

 type CMDTYPE.ICON_UNIT

CMD.UNLOAD_UNITS

 type CMDTYPE.ICON_UNIT_OR_AREA

CMD.UNLOAD_UNIT

 type CMDTYPE.ICON_MAP

CMD.ONOFF

 type CMDTYPE.ICON_MODE

CMD.RECLAIM

 type CMDTYPE.ICON_UNIT_FEATURE_OR_AREA

CMD.CLOAK

 type CMDTYPE.ICON_MODE

CMD.STOCKPILE

 type CMDTYPE.ICON

CMD.DGUN

 type CMDTYPE.ICON_MAP

CMD.RESTORE

 type CMDTYPE.ICON_AREA

CMD.REPEAT

 type CMDTYPE.ICON_MODE

CMD.TRAJECTORY

 type CMDTYPE.ICON_MODE

CMD.RESURRECT

 type CMDTYPE.ICON_UNIT_FEATURE_OR_AREA

CMD.CAPTURE

 type CMDTYPE.ICON_UNIT_OR_AREA

CMD.AUTOREPAIRLEVEL

 type CMDTYPE.ICON_MODE

CMD.LOOPBACKATTACK

 type CMDTYPE.ICON_MODE

CMD.IDLEMODE

 type CMDTYPE.ICON_MODE

CMD.SET_WANTED_MAX_SPEED

 type CMDTYPE.NUMBER

CMD.SETBASE

CMD.INTERNAL

 used in different ways

CommandTypes

Note, the CMDTYPE[] table is bidirectional. That means: CMDTYPE[CMDTYPE.ICON] := "CMDTYPE_ICON"

CMDTYPE.ICON

 expect 0 parameters in return

CMDTYPE.ICON_MODE

 expect 1 parameter in return (number selected mode)

CMDTYPE.ICON_MAP

 expect 3 parameters in return (mappos)

CMDTYPE.ICON_AREA

 expect 4 parameters in return (mappos+radius)

CMDTYPE.ICON_UNIT

 expect 1 parameters in return (unitid)

CMDTYPE.ICON_UNIT_OR_MAP

 expect 1 parameters in return (unitid) or 3 parameters in return (mappos)

CMDTYPE.ICON_FRONT

 expect 3 or 6 parameters in return (middle and right side of front if a front was defined)

CMDTYPE.COMBO_BOX

 expect 1 parameter in return (number selected option)

CMDTYPE.ICON_UNIT_OR_AREA

 expect 1 parameter in return (unitid) or 4 parameters in return (mappos+radius)

CMDTYPE.ICON_UNIT_FEATURE_OR_AREA

 expect 1 parameter in return (unitid or Game.maxUnits+featureid)
     or 4 parameters in return (mappos+radius)

CMDTYPE.ICON_BUILDING

 expect 3 parameters in return (mappos)

CMDTYPE.ICON_UNIT_OR_RECTANGLE

 expect 1 parameter in return (unitid)
     or 3 parameters in return (mappos)
     or 6 parameters in return (startpos+endpos)

CMDTYPE.NUMBER

 expect 1 parameter in return (number)

CMDTYPE.CUSTOM

 used with CMD_INTERNAL

CMDTYPE.NEXT next command page

 used with CMD_INTERNAL

CMDTYPE.PREV previous command page

 used with CMD_INTERNAL