function Tim takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit cast = GetLinkedUnit(t, "cast")
call DisplayTextToForce( GetPlayersAll(), UnitId2StringBJ(GetUnitTypeId(cast)) )
set cast = null
set t = null
endfunction
function Main takes nothing returns nothing
local timer t
local unit cast
set cast = GetTriggerUnit()
set t = CreateTimer()
call StoreHandle(t, cast, "cast")
call TimerStart(t, 0.01, true, function Tim)
call TriggerSleepAction(1.00)
call Flush(t) //Needed to avoid further leaks. Use it before you destroy the timer/trigger etc.
call DestroyTimer(t)
set t = null
set cast = null