Jump to content

Help with a short script


Recommended Posts

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

$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

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
Yes 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

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...