Sign in to follow this  
Followers 0
cueclub

Calculated random sleep =0

4 posts in this topic

Now I cant go 1 day without posting some kind of question. So here is the question of the day:

Is this possible?

And where would i find the info on it?

$t1 = InputBox("Test", "How many minutes would you like to sleep??", "")

; $t1 = iniread(@scriptdir, "test", "1", $answer)
$t2 = $t1 * 600000
$t3 = $t2 + 200000

sleep(random($t2,$t3)) 
msgbox(0, "test", "This is a test")

This is a little something i was working on with my son, and we are testing to see if it is possible to generate an input box and tie it to a random sleep command.

Thanks for any replies.

Cue ( the tinker ) adding the s is optional

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Im not quite sure i understand your question.

However..

$t2 = $t1 * 600000 ; take off one Zero. its not Six Hundred Thousand. Its Sixty  Throusand, 60,000 = 1 min.
$t3 = $t2 + 200000

But your code should work fine.

Edited by Steveiwonder

They call me MrRegExpMan

Share this post


Link to post
Share on other sites

HAHA i can be so :( sometimes.

Yup was sitting here waiting for a 60 sec test, only it was set for 60 min =\

Thanks.

And sorry for filling up the forum with a dumb math question

lol

Cue

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