dustinev Posted April 25, 2009 Share 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! Link to comment Share on other sites More sharing options...
Andreik Posted April 25, 2009 Share 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 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
dustinev Posted April 25, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
Andreik Posted April 25, 2009 Share 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 When the words fail... music speaks. 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