Dtvscrotes Posted August 22, 2007 Share Posted August 22, 2007 (edited) i want my script to return to a specific line and loop until it works example line 17 -ScriptScriptScriptScriptScriptScriptScriptScriptScriptScript line 18 -ScriptScriptScriptScriptScriptScriptScriptScriptScriptScript line 19 -ScriptScriptScriptScriptScriptScriptScriptScriptScriptScript line 20 -pixelsearch(629,222,835,396,0xFB1A15,10) line 21 -If not @error then line 22 -ScriptScriptScriptScriptScriptScriptScriptScriptScriptScript line 23 -elseif line 24 - GO BACK TO LINE 20( until it does work) Is there a way to script this GO BACK TO LINE 20( until it does work) please explain TY Edited August 22, 2007 by Dtvscrotes Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 22, 2007 Moderators Share Posted August 22, 2007 (edited) If you're in a loop, then you can do variable conditioning... Line 2 If var = xyz Then do somethng Line 3 If var = abc Then do something/var = xyz Or if you're in a loop, and somewhere in that loop you want to start back at the beginning of the loop, just use "ContinueLoop", which will restart the loop from that line. Edit: In your case, you would do a nested loop though: While 1 Line 2 Line 3 Line 4... Do $pixsearch = PixelSearch(etc...) Sleep(10) Until IsArray($pixsearch) Edited August 22, 2007 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...
enaiman Posted August 22, 2007 Share Posted August 22, 2007 Take a look at While/WEnd loops and Do/Until SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
laffo16 Posted August 22, 2007 Share Posted August 22, 2007 use the do... until or while statements to achieve this,http://www.autoitscript.com/autoit3/files/...keywords/Do.htmDim $coord Do $coord = pixelsearch(629,222,835,396,0xFB1A15,10) Until Not @error MsgBox(0, "", $coord[0] & " - " & $coord[1]) Link to comment Share on other sites More sharing options...
Dtvscrotes Posted August 22, 2007 Author Share Posted August 22, 2007 K the Do......Until thing worked ty. K ty for all the responds 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