Jump to content

Help with my script!


Recommended Posts

Hello, I'm new here and i need help fixing my script. (Side note, i just started AutoIt yesterday)

Anyways the script below isn't performing the commands i want it to do.

$start = 1

$coor = PixelSearch(415, 334, 461, 344, 0xC94336, 1, 1)

While $start = 1

Sleep(5000)

If IsArray($coor) = True Then

MouseClick("left", 520, 480, 1)

EndIf

WEnd

What i want to do is, i want this script to search if the specified color is there. If it is, then the will be mouse programmed to click on a certain coordinate. I also want this command to loop, so it will constantly check for that color, and click that certain coordinate.

Edited by BeautifulWar
Link to comment
Share on other sites

Try this here code:

While True
    Sleep(5000) 
    $coor = PixelSearch(415, 334, 461, 344, 0xC94336, 1, 1) 
    If IsArray($coor) Then MouseClick("left", 520, 480, 1)
WEnd
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...