Sign in to follow this  
Followers 0
OnTheFly

PixelSearch Array Error

4 posts in this topic

Hi, this is my code:

HotKeySet("{ENTER}", "killme")
$on = 0

WinWaitActive("Hamsterpaj.net - Onlinespel, community, forum och annat kul ;)")
MouseClick("left", 500, 600, 1)
While $on = 0
$cor = PixelSearch( 187, 150, 811, 672, 0xFFFFFF )
MouseMove($cor[0], $cor[1], 0)
WEnd



Func killme()
Exit 0
EndFunc

When the mouse click is done, i get an error message that says that $cor is a non-array variable. What's wrong?

Share this post


Link to post
Share on other sites



Hi, this is my code:

HotKeySet("{ENTER}", "killme")
$on = 0

WinWaitActive("Hamsterpaj.net - Onlinespel, community, forum och annat kul ;)")
MouseClick("left", 500, 600, 1)
While $on = 0
$cor = PixelSearch( 187, 150, 811, 672, 0xFFFFFF )
MouseMove($cor[0], $cor[1], 0)
WEnd
Func killme()
Exit 0
EndFunc

When the mouse click is done, i get an error message that says that $cor is a non-array variable. What's wrong?

The pixel wasn't found, so no array is returned. Always check your return values/error codes...

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

The pixel wasn't found, so no array is returned. Always check your return values/error codes...

Why can't the script find the pixel?

Share this post


Link to post
Share on other sites

Why can't the script find the pixel?

Because the helpfile says...

Failure: Sets @error to 1 if color is not found.

and you need to check for that condition in your code to avoid issue.

Share this post


Link to post
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
Sign in to follow this  
Followers 0