Sign in to follow this  
Followers 0
lopolop

Script Pause for Func?

3 posts in this topic

i have a loop going that has a counter in it... when that reaches a certing amount then it runs a func(all in loop) does the script pause until the Function is complete? because the func takes a few seconds.

also it would be easier then having a counter but wasn't sure if i could use 2 loops in a script like just so every 10 minutes it runs the function while the other loop is still going


Share this post


Link to post
Share on other sites



Yes, the scripts waits till func is done, if you use it like this:

While 1
Sleep (100)
MySleep ()
WEnd

Func MySleep ()
ConsoleWrite ("Start"&@CR)
Sleep (1000 *5 )
ConsoleWrite ("Stop"&@CR)
EndFunc

What about using AdlibEnable() ???

You could replace loop with AdlibEnable ( "Task", 1000 ) to run Task once a second.

Share this post


Link to post
Share on other sites

Yes, the scripts waits till func is done, if you use it like this:

While 1
Sleep (100)
MySleep ()
WEnd

Func MySleep ()
ConsoleWrite ("Start"&@CR)
Sleep (1000 *5 )
ConsoleWrite ("Stop"&@CR)
EndFunc

What about using AdlibEnable() ???

You could replace loop with AdlibEnable ( "Task", 1000 ) to run Task once a second.

even with an adlib, the main thread of the script pauses during execution. If you really need the two threads to run concurrently, you should put the secondary function in a compile script of it's own, and call it as necessary with Run(), passing the function parameters as command line arguments.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0