lolp1 Posted December 25, 2006 Share Posted December 25, 2006 I can't seem to find out how to randomize sleep between 4 mintues, and 4 1/2 mintues. Any help ? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 25, 2006 Moderators Share Posted December 25, 2006 I can't seem to find out how to randomize sleep between 4 mintues, and 4 1/2 mintues. Any help ?Sleep(Random(240000, 270000, 1)) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
lolp1 Posted December 25, 2006 Author Share Posted December 25, 2006 Thanks Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 25, 2006 Moderators Share Posted December 25, 2006 (edited) ThanksWelcome, some simple math would have fixed it for you as well. _SleepRandom(4, 4.5) Func _SleepRandom($nMin1, $nMin2) Return Sleep(Random((Number($nMin1) * 60) * 1000, (Number($nMin2) * 60) * 1000, 1)) EndFunc Edit: Oops, I used $nMin1 for both. Edited December 25, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
frixionburne Posted December 25, 2006 Share Posted December 25, 2006 couldn't you also assign a random variable and use that in the sleep command? like sleep($var1) and then have the variable be a random number? Just wondering, might be more useful to make a variable if the statement is being used more than once in the program. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 25, 2006 Moderators Share Posted December 25, 2006 couldn't you also assign a random variable and use that in the sleep command?like sleep($var1) and then have the variable be a random number? Just wondering, might be more useful to make a variable if the statement is being used more than once in the program.Your suggestion is no different than what I presented. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 25, 2006 Share Posted December 25, 2006 Smoke_N's is just more refined then going _SleepRandom(4, 4.5) Func _SleepRandom($nMin1, $nMin2) $var1 = Random((Number($nMin1) * 60) * 1000, (Number($nMin2) * 60) * 1000, 1) Return Sleep($var1) EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now