Jump to content

PixelSearch Problem


Recommended Posts

Ok well im tryin to get it to find a purple rectangle that moves. So i got a bigger Rectangle to look for it.

Everytime it gives @error.

Script

Func Heal ()
MouseClick ( "left", 770, 432, 1, 5 )
Sleep ( 700 )
MouseClick ( "left", 590, 493, 1, 5 )
Sleep ( 5000 )
$coord = PixelSearch ( 273, 578, 367, 350, 0xA420FC, 30, 2 )
Sleep ( 300 )
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf
EndIf
    EndFunc
Link to comment
Share on other sites

  • Moderators

Func Heal ()
    MouseClick ( "left", 770, 432, 1, 5 )
    Sleep ( 700 )
    MouseClick ( "left", 590, 493, 1, 5 )
    Sleep ( 5000 )
    $coord = PixelSearch ( 273, 578, 367, 350, 0xA420FC, 30, 2 )
    If Not @error And IsArray($coord) Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndFunc

Edit:

Also, you do know that your Y coords are probably backwards? looks like this: 273, 578, 367, 350 should probably be this: 273, 350, 367, 578 ?

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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