Jump to content
Sign in to follow this  
Dezypher

Learning PixelSearch

Recommended Posts

Dezypher

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

Share this post


Link to post
Share on other sites
qazwsx

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.

Share this post


Link to post
Share on other sites
Dezypher

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?

Share this post


Link to post
Share on other sites
weaponx

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")

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.