Bubblewrap Posted October 9, 2009 Share Posted October 9, 2009 Very new to this program. So heres my super simple script(right click repeatedly) but I am having trouble figuring out how to random a sleep timer. Trying to set a random time on the sleep that is within the Do...Until loop. Also, is there a way to make AutoIt recognize hotkeys while its running in the background? Thanks for any help Global $click = InputBox ("Right Clicker", "How many clicks?", "400", "") Func countDown($click) $click -= 1 return $click MsgBox( "counter", "$click") EndFunc Sleep(10000) Do $click = countDown($click) MouseClick("right") Sleep(5000) ; <--help me randomize this sleep timer! Until $click = 0 Exit Link to comment Share on other sites More sharing options...
Developers Jos Posted October 9, 2009 Developers Share Posted October 9, 2009 (edited) Have you opened the helpfile and searched for the word random? Jos Edited October 9, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Bubblewrap Posted October 9, 2009 Author Share Posted October 9, 2009 yup, heres what i attempted to do Sleep(Random(5000,7000,1)) and also tried righting a quick function with random inside it but that wouldnt work for me if there was more than just the 1 timer i was trying to random Link to comment Share on other sites More sharing options...
Developers Jos Posted October 9, 2009 Developers Share Posted October 9, 2009 yup, heres what i attempted to do Sleep(Random(5000,7000,1)) and also tried righting a quick function with random inside it but that wouldnt work for me if there was more than just the 1 timer i was trying to randomSleep() statement as you wrote it will work fine, but I am lost on what you are saying in the second part of your reply.So what is the exact problem you are having?Jois SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Bubblewrap Posted October 9, 2009 Author Share Posted October 9, 2009 Wow...go me. Must've had a typo in it when I tried in the actual script. Working now...no problem. Thanks for puttin up with me ^^ Link to comment Share on other sites More sharing options...
jebus495 Posted October 9, 2009 Share Posted October 9, 2009 Very new to this program. So heres my super simple script(right click repeatedly) but I am having trouble figuring out how to random a sleep timer. Trying to set a random time on the sleep that is within the Do...Until loop. Also, is there a way to make AutoIt recognize hotkeys while its running in the background? Thanks for any help Global $click = InputBox ("Right Clicker", "How many clicks?", "400", "") Func countDown($click) $click -= 1 return $clickhttp://www.autoitscript.com/forum/index.php?app=forums&module=post§ion=post&do=reply_post&f=2&t=103702&qpid=734384 MsgBox( "counter", "$click") EndFunc Sleep(10000) Do $click = countDown($click) MouseClick("right") Sleep(5000) ; <--help me randomize this sleep timer! Until $click = 0 Exit Global $click = InputBox ("Right Clicker", "How many clicks?", "400", "") Func countDown($click) $click -= 1 return $click EndFunc ToolTip($click, 0, 0, "# of clicks") Sleep(10000) Do $click = countDown($click) MouseClick("right") ToolTip($click, 0, 0, "# of clicks") Sleep(Random(5000,7000,1)) Until $click = 0 ToolTip("") Exit That is my version of your script. MsgBox( "counter", "$click") That needs to be MsgBox("", "counter", $click) 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