I'm currently trying to get through the dschungle of timer systems and stuff. TimerUtils seems to be ok, but what I'm missing is some examples on how to use it.
This little testcode could be easily done without TimerUtils. :/
(I'm searching for a way to simulate TriggerSleepAction - the devil of all natives)
What bothers me are those two local timer variables. Do they leak? And if yes, will nulling them have any effect on the code/TimerUtils?
This little testcode could be easily done without TimerUtils. :/
(I'm searching for a way to simulate TriggerSleepAction - the devil of all natives)
JASS:
function Test123 takes nothing returns nothing
local timer t=GetExpiredTimer()
if GetTimerData(t)==2 then
call BJDebugMsg("works")
endif
if GetRandomInt(1,3)==1 then
call ReleaseTimer(t)
endif
endfunction
function Trig_testing_Actions takes nothing returns nothing
local timer t=NewTimer()
call SetTimerData(t,2)
call TimerStart(t,2.,true,function Test123)
endfunction
//===========================================================================
function InitTrig_testing takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterTimerEvent(t,10,false)
call TriggerAddAction( t, function Trig_testing_Actions )
set t=null
endfunction
What bothers me are those two local timer variables. Do they leak? And if yes, will nulling them have any effect on the code/TimerUtils?