Max in montreal Posted March 22, 2007 Share Posted March 22, 2007 i need to create a loop, i need the loop to keep going untill a pixel color is x or y. so how do i say do bla bla until $var = x or $var = y i guess its the OR i am looking for. thanks in advance. Link to comment Share on other sites More sharing options...
_Kurt Posted March 22, 2007 Share Posted March 22, 2007 $PixelSearch = PixelSearch( 0, 0, 20, 300, 0xFF0000 ) Do Sleep(10) PixelSearch( 0, 0, 20, 300, 0xFF0000 ) Until IsArray($PixelSearch) This will loop until the pixelsearch returns it's coordinates. Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
CrewXp Posted March 22, 2007 Share Posted March 22, 2007 What exactly is x and y, you're referring to? Are you wanting to run a script until the pixelcolor at a certain coordinate is returned to a certain color? If it's at a coordinate... While 1 $var = PixelGetColor( x,y ) ;Where x and y are the coordinates If $var[0]=$xcol Then ;Where $xcol is the desired pixel color in decimal value ExitLoop ElseIf $var[1]=$ycol Then ;Where $ycol is the desired pixel color in decimal value ExitLoop EndIf Wend A little more basic and easier to understand, if it's what you need. Link to comment Share on other sites More sharing options...
Max in montreal Posted March 22, 2007 Author Share Posted March 22, 2007 let me rephrase my question... this is what i have... Do $var = 0 $var = PixelGetColor( 975, 892) ; get the color to see if its a turbo or a 6 man sleep (100) until $var = 16777215 or $var = 16777213 the second $var is a made up number, but can i some how throw an OR in there like i did? Link to comment Share on other sites More sharing options...
Max in montreal Posted March 22, 2007 Author Share Posted March 22, 2007 (edited) thats great, never used exit loop before...thank you, its perfect! Max Edited March 22, 2007 by Max in montreal Link to comment Share on other sites More sharing options...
therks Posted March 22, 2007 Share Posted March 22, 2007 let me rephrase my question...this is what i have...Do $var = 0 $var = PixelGetColor( 975, 892) ; get the color to see if its a turbo or a 6 man sleep (100)until $var = 16777215 or $var = 16777213the second $var is a made up number, but can i some how throw an OR in there like i did?I just had to ask... what was wrong with this code that you couldn't use it? My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Max in montreal Posted March 23, 2007 Author Share Posted March 23, 2007 (edited) $var = 0 Do $var = 0 $var = PixelGetColor( 975, 892) ; get the color to see if its a turbo or a 6 man sleep (100) if $var = 21648 Then ExitLoop until $var = 16777215 MouseClick("left", 975, 892, 2) so i changed it to the above, im getting an error this is the way i did it, thanks all! Edited March 23, 2007 by Max in montreal 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