Sparrowlord Posted July 1, 2007 Share Posted July 1, 2007 Func check() $coord = 0 $coord = PixelSearch( 417, 325, 452, 343, 0xCCBC94, 1 ) If Not @error Then MouseMove ($coord[0], $coord[1]) EndIf EndFunc I'm getting this error message: ==> Subscript used with non-Array variable.: MouseMove ($coord[0], $coord[1]) MouseMove ($coord^ ERROR My problem isnt that the func dont work its that it dont work after two trys, the func is called a few times and after the second time it crashes the script. Any help? Link to comment Share on other sites More sharing options...
weaponx Posted July 1, 2007 Share Posted July 1, 2007 Func check() $coord = 0 $coord = PixelSearch( 417, 325, 452, 343, 0xCCBC94, 1 ) If IsArray ( $coord ) Then MouseMove ($coord[0], $coord[1]) EndIf EndFunc Link to comment Share on other sites More sharing options...
Sparrowlord Posted July 1, 2007 Author Share Posted July 1, 2007 Func check() $coord = 0 $coord = PixelSearch( 417, 325, 452, 343, 0xCCBC94, 1 ) If IsArray ( $coord ) Then MouseMove ($coord[0], $coord[1]) EndIf EndFunc I'm still getting the same error and it crashes after two attempts. Link to comment Share on other sites More sharing options...
BullGates Posted July 1, 2007 Share Posted July 1, 2007 Works ok in here. I've changed it to search for the red color and a bigger area. How are you calling the function? Func check() $coord = 0 $coord = PixelSearch(0, 0, 452, 343, 0xFF0000, 1) If Not @error Then MouseMove($coord[0], $coord[1]) EndIf EndFunc ;==>check While 1 check() WEnd [topic="51913"]Restrict USB Storage usage to group membership[/topic] * [topic="48699"]Using nircmd library[/topic] * Some admin notes 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