Douves Posted May 1, 2009 Share Posted May 1, 2009 Hello has all, I am French, and I use a translator, I made a script with autoit, but I would want that if the program does not find certain pixel, as it returns has the previous action(share), or, a predefined line... Is there a code for that? My code : While 1 $coord=PixelSearch( 0, 0 , 1024 , 768 ,"0xF4F4FD") If Not @error Then ;Rejoignons le combat.... Mouseclick("left", $coord[0] , $coord[1] , 1, 0) Mouseclick("left", $coord[0] + 10, $coord[1] + 10 , 1, 0) ;sortie de boucle... ExitLoop EndIf wend While 2 sleep("2000") $pret=Pixelsearch(661, 446, 719, 463, "0xFF6600") If @error Then [u][b]; I want that he(it) returns has the first line...[/b][/u] EndIf If Not @error Then Mouseclick("left", $pret[0], $pret[1], 1, 10) ExitLoop EndIf wend Link to comment Share on other sites More sharing options...
Mat Posted May 1, 2009 Share Posted May 1, 2009 (edited) Bonjour (mais mon francais est nul ) Put your entire script in another loop, and read the helpfile - look at continue loop. The rest of the script seems fairly good though. What game is it for? I do not know exactly what you are attempting to do, so this will not be 100% accurate. But it is the general idea. CODEWhile 1 While 1 $coord=PixelSearch( 0, 0 , 1024 , 768 ,"0xF4F4FD") If Not @error Then ;Rejoignons le combat.... Mouseclick("left", $coord[0] , $coord[1] , 1, 0) Mouseclick("left", $coord[0] + 10, $coord[1] + 10 , 1, 0) ;sortie de boucle... ExitLoop EndIf wend While 2 sleep("2000") $pret=Pixelsearch(661, 446, 719, 463, "0xFF6600") If @error Then ContinueLoop[2] Else Mouseclick("left", $pret[0], $pret[1], 1, 10) ExitLoop EndIf wend WEnd Edit: added level to continue loop. Edited May 1, 2009 by mdiesel AutoIt Project Listing Link to comment Share on other sites More sharing options...
Douves Posted May 1, 2009 Author Share Posted May 1, 2009 Perfetc, thank you Link to comment Share on other sites More sharing options...
Mat Posted May 1, 2009 Share Posted May 1, 2009 no probs. If you want to include more loops, just change the level of continue loop! as for part 2 of returning to a specific line, just change the location of the loops, make sure you are still nesting it properly though. MDiesel AutoIt Project Listing 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