Jump to content

Learning PixelSearch


Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...