dustinev Posted April 25, 2009 Posted April 25, 2009 Hello. I am in need of a script that gets the color of a pixel (say at 500,500 for example) and clicks the left mouse button after 2-3 seconds if that pixel is not a certain color. Thanks for any help!
Andreik Posted April 25, 2009 Posted April 25, 2009 Hello. I am in need of a script that gets the color of a pixel (say at 500,500 for example) and clicks the left mouse button after 2-3 seconds if that pixel is not a certain color. Thanks for any help!$COLOR = PixelGetColor(500,500) If Hex($COLOR,6) <> 0xFFFFFF Then;If color is not black click to 500,500 Sleep(2000) MouseClick("left",500,500) EndIf
dustinev Posted April 25, 2009 Author Posted April 25, 2009 $COLOR = PixelGetColor(500,500) If Hex($COLOR,6) <> 0xFFFFFF Then;If color is not black click to 500,500 Sleep(2000) MouseClick("left",500,500) EndIf Thanks for the quick reply! Okay, now lets say I want it to get the color of a pixel at position 500,500 and if the color at that position is 0xFFFFFF, click the left mouse button. I also need it to loop indefinitely. Would the following work? $COLOR = PixelGetColor(500,500) While 1=1 If $COLOR = 0xFFFFFF Then Sleep(2500) MouseClick("left",500,000) EndIf WEnd
Andreik Posted April 25, 2009 Posted April 25, 2009 Thanks for the quick reply! Okay, now lets say I want it to get the color of a pixel at position 500,500 and if the color at that position is 0xFFFFFF, click the left mouse button. I also need it to loop indefinitely. Would the following work? $COLOR = PixelGetColor(500,500) While 1=1 If $COLOR = 0xFFFFFF Then Sleep(2500) MouseClick("left",500,000) EndIf WEndYes just put a sleep in your loop. $COLOR = PixelGetColor(500,500) While 1 If $COLOR = 0xFFFFFF Then Sleep(2500) MouseClick("left",500,000) EndIf Sleep(20) WEnd
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