Jump to content

Stumped


Recommended Posts

I'm trying to make a simple script that checks to see if a location on the screen is yellow, then, if it is: clicks that location, if it isn't: waits until it is and then clicks the location.

This is what I have:

WinWaitActive("WindowNameHere")



While 1 = 1
    $color = PixelGetColor(388,367)
    if $color= 16777215 Then
        MouseClick("left",388,367,1,0)
    EndIf

WEnd

But for some reason, the program goes into an infinate loop, takes control of the mouse, and clicks consantly even though there is no instance of the designated color in sight.

Does anyone know why this is? Help would be GREATLY appreciated because I've spent hours on this. Thanks.

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