Jump to content

strange error with array


Recommended Posts

Hi there and thanks for your time.  I'm running a scrip and, part of it, involves PixelSearch() - then clicking on the location the pixel was found.  Here's what I've got:

$coord = PixelSearch(368, 161, 1301, 679, 0x0DA2D8, 10)
$x = $coord[0]
$y = $coord[1]

MouseClick("left", $x, $y)

I've delcare them as Local variables AND as DIM in different verison of the script but the same thing happens.  The script runs fine and the function works, 3, 4, 5 times (its in a WHILE loop) then later in the looping it crashes with the error that $coord isn't an array.  Any thoughts why it works and then suddenly doesn't?

thanks!

 

 

Link to comment
Share on other sites

  • Developers

PixelSearch() doesn't return an Array in case the color isn't found. Test the @error value first.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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