HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Wait for function?

01-17-2004, 12:04 AM#1
Narwanza
is there a wait for function? An example would be i want the trigger to wait for i to be = to j. Would call TriggerSleepAction( i = j ) work?
01-17-2004, 12:42 AM#2
Scarlet-Russian
loop it

for each integer a from 1 to -1 do
-wait .5 seconds
-if i = j custom script "set bj_forLoopIndexA = -1"
01-17-2004, 01:03 AM#3
Eriond
The wait for condition function is what you want I think... not sure what it is in JASS, you can just convert to custom text and check...
01-17-2004, 01:45 AM#4
weaaddar
I'll say this is a very bad way of doing something. Anything with waits brings your thread closer to its timeout limit.

Unless I and J are something you are manipulating inside this very loop never do it that.
but heres goes...
loop
exitwhen (i==j
...stuff here...
TriggerSleepAction(0.1) //a small amount of time but still accurate
endloop