Jump to content
Sign in to follow this  
Satyrn

Random - Sleep

Recommended Posts

Satyrn

Hi everyone,

I'm writing a little scipt and I'd like to know how to randomize the sleep command in a specific time range.

I don't want to waste time with long variables, so I hope that you could help me with an easy command.

Share this post


Link to post
Share on other sites
ELP22

:think:....

AdlibEnable('_rand',2000)

func _rand()
sleep(random(1,9999,1))
EndFunc

Share this post


Link to post
Share on other sites
Satyrn

Thank you both very much for the fast reply.

I'll try that right now.

Share this post


Link to post
Share on other sites
herewasplato

:think:....

AdlibEnable('_rand',2000)

func _rand()
sleep(random(1,9999,1))
EndFunc
I cannot say that I've ever thought of doin' it that way - but you could get quite a delay:
AdlibEnable('_rand', 2000)

Global $sleeptime

_rand()

While 1
    ToolTip($sleeptime)
WEnd


Func _rand()
    $sleeptime = (Random(1, 9999, 1))
    Sleep($sleeptime)
EndFunc  ;==>_rand
Creative ELP22 :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.