- Joined
- Jun 5, 2006
- Messages
- 18
hi...i've created a function in JASS (because it's really easier and shorter to use by giving it parameters instead using globals...)
unfortunately is necessary that this function uses some "Wait X" inside itself....
differently than if i do "Run trigger (ignoring conditions)", my triggers wait the ends of the function (and that's not good because this should be a thing that happens WHILE the trigger is running)
can you help me?Maybe i have to use a trigger to do this right?
here is the code (i will note post the GUI code because is very long)
i've done it with a trigger (by simply adding the function to trigger actions)
a question...are there any better ways to do it?:O
unfortunately is necessary that this function uses some "Wait X" inside itself....
differently than if i do "Run trigger (ignoring conditions)", my triggers wait the ends of the function (and that's not good because this should be a thing that happens WHILE the trigger is running)
can you help me?Maybe i have to use a trigger to do this right?
here is the code (i will note post the GUI code because is very long)
JASS:
function FDDcastbar takes integer mySpell, integer myPg returns nothing
local real intervalli = ( FDDspellinfoDELAY(mySpell) / 20.00 )
local real lastInterval = ModuloReal(FDDspellinfoDELAY(mySpell), 20.00)
local string castBar = " "
local integer cicloA = 1
local integer cicloB = 1
loop
exitwhen cicloA > 10
set cicloB = 1
loop
exitwhen cicloB > cicloA
set castBar = ( castBar + "|c00ffffffl |r" )
set cicloB=cicloB+1
endloop
set cicloB=cicloA+1
loop
exitwhen cicloB > 10
set castBar = ( castBar + "|c00ff0000l |r" )
set cicloB=cicloB+1
endloop
call TriggerSleepAction( intervalli )
if ( cicloA == 10 ) then
call TriggerSleepAction( lastInterval )
endif
call LeaderboardSetPlayerItemLabelBJ( ConvertedPlayer(myPg), udg_FDD_CastBar[myPg], castBar )
set castBar = " "
set cicloA=cicloA+1
endloop
call LeaderboardSetPlayerItemLabelBJ( ConvertedPlayer(myPg), udg_FDD_CastBar[myPg], "|c00ffffff l l l l l l l l l l |r" )
endfunction
i've done it with a trigger (by simply adding the function to trigger actions)
a question...are there any better ways to do it?:O