OnTheFly Posted February 12, 2007 Share Posted February 12, 2007 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? Link to comment Share on other sites More sharing options...
PaulIA Posted February 12, 2007 Share Posted February 12, 2007 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 Link to comment Share on other sites More sharing options...
OnTheFly Posted February 12, 2007 Author Share Posted February 12, 2007 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? Link to comment Share on other sites More sharing options...
MHz Posted February 12, 2007 Share Posted February 12, 2007 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now