Alexxander Posted February 10, 2014 Share Posted February 10, 2014 (edited) hi all i have this code while 1 If PixelSearch(300,60,360,300,4558577) <> 0 Then left() If PixelSearch(40,60,100,300,4558577)<> 0 Then right() Sleep(1000) WEnd when it finds a pixel on a rectangle on the screen it do function left when it finds the same pixel on another rectangle on the screen it do function right how can i make it when i finds the pixel on the two rectangles at the same time it do another function without doing right and left functions ? maybe it should be while 1 If PixelSearch(300,60,360,300,4558577) And PixelSearch(40,60,100,300,4558577) <> 0 Then third() If PixelSearch(300,60,360,300,4558577) <> 0 Then left() If PixelSearch(40,60,100,300,4558577)<> 0 Then right() Sleep(1000) WEnd any ideas ? but i think that this code will do the third function when it found it on the 2 rectangles but it will still do right and eft Edited February 10, 2014 by Alexxander Link to comment Share on other sites More sharing options...
JohnOne Posted February 10, 2014 Share Posted February 10, 2014 While 1 If PixelSearch(300, 60, 360, 300, 4558577) And PixelSearch(40, 60, 100, 300, 4558577) <> 0 Then third() Else If PixelSearch(300, 60, 360, 300, 4558577) <> 0 Then left() If PixelSearch(40, 60, 100, 300, 4558577) <> 0 Then right() EndIf Sleep(1000) WEnd Alexxander 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Solution nullschritt Posted February 10, 2014 Solution Share Posted February 10, 2014 (edited) Try this while 1 Select case PixelSearch(300,60,360,300,4558577) <> 0 And PixelSearch(40,60,100,300,4558577) <> 0 third() case PixelSearch(300,60,360,300,4558577) <> 0 left() Case PixelSearch(40,60,100,300,4558577) <> 0 right() EndSelect Sleep(1000) WEnd Edited February 10, 2014 by nullschritt Alexxander 1 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