Jump to content
Sign in to follow this  
qbt

Need help - "sleep" or "wait" command.

Recommended Posts

Hello, i have been struggling with a problem lately. Thing is, i need a script to "wait" or "sleep" a certain time.

I searched the wiki and the forums. First tried using triggers, and made them repeat and with a timeout/countdown, but for some reason the triggers do not repeat.

Is this a bug in the game or am I just doing something wrong?

UPDATE:

Okay, I think I got it. If anyone else wants to know how its done what you basically want to do is just use ~.

ie.

#loop
hint "Hello!"
~5
goto "loop"

This willl hint "Hello" every 5 seconds! Thanks :)

Edited by qbt

Share this post


Link to post
Share on other sites

Could you not just put a loop in the script? i.e

#loop
rest of your script
goto "loop"

Regards,

LEGION7698.

Share this post


Link to post
Share on other sites

Thanks for the quick reply LEGION7698! :) The problem is, that that loops so quickly. I would need it to be like:

#loop
hint "123"
[i]wait/sleep 2[/i]
goto "loop"

So this only happens every 2 seconds.

E: I also thought of using time and if sentences, but this too loops quickly and takes much CPU usage..

Edited by qbt

Share this post


Link to post
Share on other sites

there are basically 2 ways to halt a script. either use "~" or "@"

"~" is used along with a number or a variable and pauses the script for a specific amount of time (~5 or ~_timeVariable)

"@" is used with any condition and pauses the script until that condition is met (@a>b or @ driver tank == myUnit)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×