globals
boolean stop = true
endglobals
//===========================================================================
// loop function when this function is called it will start the loop and when a unit moves it will stop
function loop_function takes nothing returns nothing
loop
exitwhen stop == false
endloop
set stop = true //reset the stop variable so it can be used again
endfunction
//===========================================================================
// trigger Actions and Conditions
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
set stop = false
endfunction
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
return GetIssuedOrderId() == OrderId("move")
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_001, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( gg_trg_Untitled_Trigger_001, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction