Dezypher Posted August 27, 2007 Share Posted August 27, 2007 hello all I Have been trying to figure out Pixelsearch for the past 3 hours...i just cant seem to figure out how to get it to do what I want. what i am trying to do is have it watch an area on the screen for yellow...once it sees yellow in this area to send a {SPACE} and then send a Z. So the yellow is not there by default but once it shows up it needs to send the characters listed above. my problem is i dont see a way to loop a wait or sleep so that the script will wait for the yellow to show up then hit space and z...and continue on with the script... any help would be greatly appreachited...just fustated right now thanks Link to comment Share on other sites More sharing options...
qazwsx Posted August 28, 2007 Share Posted August 28, 2007 can u show us your code? You would want to loop pixel search for the color and assign a variable to it. Then do a If _isarray then to do wat you want when its found. Link to comment Share on other sites More sharing options...
weaponx Posted August 28, 2007 Share Posted August 28, 2007 While 1 $RESULT = PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] ) If NOT @ERROR Then Send("{SPACE}") Send ("Z") ;Uncomment next line to break loop if pixel found ;ExitLoop EndIf Sleep(250) WEnd Link to comment Share on other sites More sharing options...
Dezypher Posted August 28, 2007 Author Share Posted August 28, 2007 ok i have tried this Sleep(5000) Send("A") While 1 $RESULT = PixelSearch ( 809, 410, 814, 418, 0xdbdd48, 12) If NOT @ERROR Then Send("{SPACE}") Send ("Z") ;Uncomment next line to break loop if pixel found ;ExitLoop EndIf Sleep(10) WEnd Sleep(3500) Send("A") but i do not see the yellow color or if the script detects teh yellow its not sending the space and the z any ideas? Link to comment Share on other sites More sharing options...
weaponx Posted August 28, 2007 Share Posted August 28, 2007 Put a MsgBox in there or something, or even a ConsoleWrite Sleep(5000) Send("A") While 1 $RESULT = PixelSearch ( 809, 410, 814, 418, 0xdbdd48, 12) If NOT @ERROR Then MsgBox(0,"","Pixel found") Send("{SPACE}") Send ("Z") ;Uncomment next line to break loop if pixel found ;ExitLoop EndIf Sleep(10) WEnd Sleep(3500) Send("A") 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