Arez Posted July 15, 2007 Share Posted July 15, 2007 Everytime the code loops, I want MouseClick("left", 721, 686, 1, 2.5) sleep(2000) to be repeated +1 So by the 4th loop, the above code would be used +4 more times than the others. is there a way to do this? sleep(2000) HotKeySet("{NumPadAdd}","getpos") HotKeySet("{END}","quitme") While 1 MouseClick("left", 718, 424, 1, 2.5) sleep(2000) MouseClick("left", 721, 686, 1, 2.5) sleep(2000) MouseClick("left", 487, 438, 1, 2.5) sleep(2000) MouseClick("left", 564, 467, 1, 2.5) sleep(2000) MouseClick("left", 16, 68, 1, 2.5) Sleep(3000) WEnd func quitme() exit EndFunc func getpos() EndFunc Link to comment Share on other sites More sharing options...
SadBunny Posted July 15, 2007 Share Posted July 15, 2007 Everytime the code loops, I want MouseClick("left", 721, 686, 1, 2.5) sleep(2000) to be repeated +1 So by the 4th loop, the above code would be used +4 more times than the others. is there a way to do this? sleep(2000) HotKeySet("{NumPadAdd}","getpos") HotKeySet("{END}","quitme") While 1 MouseClick("left", 718, 424, 1, 2.5) sleep(2000) MouseClick("left", 721, 686, 1, 2.5) sleep(2000) MouseClick("left", 487, 438, 1, 2.5) sleep(2000) MouseClick("left", 564, 467, 1, 2.5) sleep(2000) MouseClick("left", 16, 68, 1, 2.5) Sleep(3000) WEnd func quitme() exit EndFunc func getpos() EndFunc Have a variable increment by 1 every loop (like $timesToRun), and for-next loop the command you want to repeat more often, like for $i = 1 to $timesToRun Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Arez Posted July 15, 2007 Author Share Posted July 15, 2007 I'm lost here. how would I implement that in the middle of the code? Link to comment Share on other sites More sharing options...
Siao Posted July 15, 2007 Share Posted July 15, 2007 (edited) $repeat = 1 sleep(2000) HotKeySet("{NumPadAdd}","getpos") HotKeySet("{END}","quitme") While 1 MouseClick("left", 718, 424, 1, 2.5) sleep(2000) For $i = 1 To $repeat MouseClick("left", 721, 686, 1, 2.5) sleep(2000) Next MouseClick("left", 487, 438, 1, 2.5) sleep(2000) MouseClick("left", 564, 467, 1, 2.5) sleep(2000) MouseClick("left", 16, 68, 1, 2.5) Sleep(3000) $repeat += 1 WEnd func quitme() exit EndFunc func getpos() EndFunc Edited July 15, 2007 by Siao "be smart, drink your wine" 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