Commands¶
Find the action you want below. Each group page starts with a linked task index; select a command name for its description, inputs, output, and errors. The searchable API name index links command names directly to those entries. Use global functions in new scripts.
Basic result rule¶
A command returning true has entered WololoLabs' queue. It may still fail before native submission, and native submission does not prove the game performed the action. For a simple one-shot order, use the ordinary name. For later transport evidence, use the Tracked version and release its receipt.
local player = GetAssignedPlayer()
local selected = player and player:GetSelectedObject()
if selected then
local accepted = UnitsMove(selected, Vector2(42, 42))
if not accepted then LogWarn("Move request was not queued") end
end
Pass one Object or a dense array of objects where a command needs units or buildings. A position is { x = number, y = number }; Vector2(x, y) is often easier to read.
Find a command¶
| Task | Common calls | Reference |
|---|---|---|
| Move, stop, target, patrol, attack | UnitsMove, UnitsStop, UnitsTargetObject, UnitsAttackGround |
Movement and orders |
| Train, research, build, cancel | TrainUnit, ResearchTechnology, UnitsBuildStructure, CancelProduction |
Production and building |
| Garrison, unload, pack, town center | UngarrisonUnit, UngarrisonTo, UnitsPack, RingTownBell |
Unit and town controls |
| Lock or toggle gates | LockGates, ToggleGate |
Gate commands |
| Market, tribute, diplomacy, match | BuyCommodity, TributeToPlayer, SetDiplomacy, Resign |
Market and match commands |
Use the API name index if you know a name but cannot find its group. Older api table aliases are in Legacy api namespace.
What happens after admission¶
The queue copies command identities and checks the originating game session again before dispatch. It re-resolves actor IDs and checks liveness and captured ownership. Human commands observed since capture can invalidate the group; expired observer history also rejects it when authority cannot be established. Target and market commands revalidate their original targets. Leaving the game session discards its queued commands.
Human-order protection depends on an enabled observer recognizing the packet and on frame-thread ordering. A receipt can show native submission, but only later game-state reads can show an effect. See Write reliable scripts for repeated orders and Command receipts for command lifecycle details.