Nitto Posted June 11, 2007 Share Posted June 11, 2007 (edited) i wanna make this code repeat X number of times but don't know how to code it, help always appreciated also corrections. THANKS ; Script Start - Add your code below here AutoItSetOption ("CaretCoordMode", 0) WinMinimizeAll() WinActivate("Nitto 1320 Challenge") ;How do i put loop MouseClick("left", 729, 513);Online Challenge Sleep(2100) MouseClick("left", 393, 451);Select Racer Sleep(3200) MouseClick("left", 674, 642);Select Car Sleep(500) MouseClick("left", 586, 634);OK Car Ready Sleep(500) MouseClick("left", 459, 468);Select Bracket Sleep(500) MouseClick("left", 786, 513);Ok Bracket Sleep(500) MouseClick("left", 405, 462);Race for Fun Sleep(500) MouseClick("left", 474, 468);Select Track and Lane Sleep(500) MouseClick("left", 733, 611);Start The Race Sleep(4200) MouseClick("left", 310, 386);Set R/T Sleep(500) Send("^a") Send(StringLeft(Random(0.510, 0.545), 5)) MouseClick("left", 310, 419);Set E/T Sleep(500) Send("^a") Send(StringLeft(Random(6.230, 6.250), 5)) MouseClick("left", 312, 455);Set MPH Sleep(500) Send("^a") Send(StringLeft(Random(204.00, 205.00), 6)) MouseClick("left", 289, 481);Set Sleep(1300) MouseClick("left", 717, 498);Race Someone Else Sleep(500) Edited June 11, 2007 by Nitto Link to comment Share on other sites More sharing options...
Generator Posted June 11, 2007 Share Posted June 11, 2007 Try this? expandcollapse popup; Script Start - Add your code below here AutoItSetOption ("CaretCoordMode", 0) WinMinimizeAll() WinActivate("Nitto 1320 Challenge") ;How do i put loop For $i=1 to 5 MouseClick("left", 729, 513);Online Challenge Sleep(2100) MouseClick("left", 393, 451);Select Racer Sleep(3200) MouseClick("left", 674, 642);Select Car Sleep(500) MouseClick("left", 586, 634);OK Car Ready Sleep(500) MouseClick("left", 459, 468);Select Bracket Sleep(500) MouseClick("left", 786, 513);Ok Bracket Sleep(500) MouseClick("left", 405, 462);Race for Fun Sleep(500) MouseClick("left", 474, 468);Select Track and Lane Sleep(500) MouseClick("left", 733, 611);Start The Race Sleep(4200) MouseClick("left", 310, 386);Set R/T Sleep(500) Send("^a") Send(StringLeft(Random(0.510, 0.545), 5)) MouseClick("left", 310, 419);Set E/T Sleep(500) Send("^a") Send(StringLeft(Random(6.230, 6.250), 5)) MouseClick("left", 312, 455);Set MPH Sleep(500) Send("^a") Send(StringLeft(Random(204.00, 205.00), 6)) MouseClick("left", 289, 481);Set Sleep(1300) MouseClick("left", 717, 498);Race Someone Else Sleep(500) Next Link to comment Share on other sites More sharing options...
Paulie Posted June 11, 2007 Share Posted June 11, 2007 (edited) Loops 3 times expandcollapse popupAutoItSetOption ("CaretCoordMode", 0) WinMinimizeAll() WinActivate("Nitto 1320 Challenge") $Times = 3 $i=0 Do ;How do i put loop MouseClick("left", 729, 513);Online Challenge Sleep(2100) MouseClick("left", 393, 451);Select Racer Sleep(3200) MouseClick("left", 674, 642);Select Car Sleep(500) MouseClick("left", 586, 634);OK Car Ready Sleep(500) MouseClick("left", 459, 468);Select Bracket Sleep(500) MouseClick("left", 786, 513);Ok Bracket Sleep(500) MouseClick("left", 405, 462);Race for Fun Sleep(500) MouseClick("left", 474, 468);Select Track and Lane Sleep(500) MouseClick("left", 733, 611);Start The Race Sleep(4200) MouseClick("left", 310, 386);Set R/T Sleep(500) Send("^a") Send(StringLeft(Random(0.510, 0.545), 5)) MouseClick("left", 310, 419);Set E/T Sleep(500) Send("^a") Send(StringLeft(Random(6.230, 6.250), 5)) MouseClick("left", 312, 455);Set MPH Sleep(500) Send("^a") Send(StringLeft(Random(204.00, 205.00), 6)) MouseClick("left", 289, 481);Set Sleep(1300) MouseClick("left", 717, 498);Race Someone Else Sleep(500) $i+=1 Until $i=3 EDIT: Beaten... Edited June 11, 2007 by Paulie Link to comment Share on other sites More sharing options...
Nitto Posted June 11, 2007 Author Share Posted June 11, 2007 Thanks, if i change the 5 for 10 it will be repeated 10 times?? For $i=1 to 5 Link to comment Share on other sites More sharing options...
Achilles Posted June 11, 2007 Share Posted June 11, 2007 Thanks, if i change the 5 for 10 it will be repeated 10 times?? For $i=1 to 5Yes You can use any number: For $i = 1 to 5 For $i = 1 to 10 For $i = 2 to 6 Step 2 ;Jump two instead of the normal one For $i = 5 to 1 Step -1 ;Go backwards My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Nitto Posted June 11, 2007 Author Share Posted June 11, 2007 Anyone could also tell me how to put a command to exit the script please. Link to comment Share on other sites More sharing options...
evilertoaster Posted June 11, 2007 Share Posted June 11, 2007 Exit Tell me that isn't epic... Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 11, 2007 Share Posted June 11, 2007 ExitoÝ÷ Ù7¥g«b²}ýµêbsú®¢×ìb¶Ø^Jkjz7öË®*mjëh×6If LearnToParallelPark($Meadow) Then Exit Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Generator Posted June 11, 2007 Share Posted June 11, 2007 Add a hotkey if you want to Example: HotKeySet("{ESC}","_Quit") ;Rest script goes here Func _Quit() Exit 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