flip2405 Posted April 24, 2008 Posted April 24, 2008 (edited) f okay if the pixel is not red blue or white to first get pixel color then return pixel color to a variable then click untill the color of the pixel changes please help with this i just need an example im just useing red blue and white as an example Edited April 24, 2008 by d3m0n
flip2405 Posted April 24, 2008 Author Posted April 24, 2008 f okay if the pixel is not red blue or white to first get pixel color then return pixel color to a variable then click untill the color of the pixel changes please help with this i just need an example im just useing red blue and white as an exampleCan no one help me?
Vakari Posted April 24, 2008 Posted April 24, 2008 (edited) This will get the color of the pixel under your mouse cursor and check if it is red, blue, or white. If it isn't, it will click 10 times per second until the color is red, blue, or white. If the color is ever red, blue, or white, a message box will inform you and the program will close. Hold escape to exit the program. Note that it is set to work with pure red, blue, and white. If your colors are only slightly off, they will not be detected and it will click forever. So if you are looking for pure red, blue, or white, then you're all set. Otherwise, you need to specify your own colors. I'm sure there is a better alternative, but this is what I could think of. #Include <misc.au3> Global $color, $mousepos Global Const $red = "0000FF" Global Const $blue = "FF0000" Global Const $white = "FFFFFF" While 1 If _IsPressed("1B") Then Exit $mousepos = MouseGetPos() $color = Hex(PixelGetColor($mousepos[0], $mousepos[1]), 6) If $color = $red Or $color = $blue Or $color = $white Then MsgBox(262160, "Found!", $color & " found. Exiting", 1) Exit Else MouseClick("primary") EndIf Sleep(100) Wend Edited April 24, 2008 by Vakari
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