hgkjfhfdsj
Active Member
- Reaction score
- 55
http://www.thehelper.net/forums/showpost.php?p=1189499&postcount=10
based on Weep's > wrapper for a hashtable or something ?
i tried this out with:
which i don't even know if im using it right..
- compiles properly >> ie created required globals etc
- shows '0' > assumed that integer was not passed
based on Weep's > wrapper for a hashtable or something ?
JASS:
function NewTimer takes integer data, real timeout, boolean periodic, code callback returns timer
if(udg_TimerCount == 0) then
set udg_TimerStack[1] = CreateTimer()
set udg_TimerCount = 1
endif
call SaveInteger(udg_Hashtable, 0, GetHandleId(udg_TimerStack[udg_TimerCount]), data)
call TimerStart(udg_TimerStack[udg_TimerCount], timeout, periodic, callback)
set udg_TimerCount = udg_TimerCount-1
return udg_TimerStack[udg_TimerCount+1]
endfunction
function GetTimerData takes timer t returns integer
return LoadInteger(udg_Hashtable, 0, GetHandleId(t))
endfunction
function ReleaseTimer takes timer t returns nothing
if(t != null) then
call PauseTimer(t)
set udg_TimerStack[udg_TimerCount] = t
set udg_TimerCount = udg_TimerCount + 1
endif
endfunction
function InitTrig_TimerU_Clone takes nothing returns nothing
endfunction
i tried this out with:
JASS:
function time takes nothing returns nothing
local integer i = GetTimerData(GetExpiredTimer())
call BJDebugMsg(I2S(i))
endfunction
function Trig_Timer_Test_Actions takes nothing returns nothing
call NewTimer(25, 5., false, function time)
endfunction
//===========================================================================
function InitTrig_Timer_Test takes nothing returns nothing
set gg_trg_Timer_Test = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Timer_Test, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Timer_Test, function Trig_Timer_Test_Actions )
endfunction
which i don't even know if im using it right..
- compiles properly >> ie created required globals etc
- shows '0' > assumed that integer was not passed