SweatyOgre Posted May 29, 2004 Share Posted May 29, 2004 (edited) Grrrr, I get this error every time i run my script. Here's the section of code it's from:$XY = PixelSearch(314, 192, 507, 389, 0x7898D8) Sleep(3500) If Not @error Then MouseClick("left",$XY[0],$XY[1], 1, 0)Since $XY apparently isn't an array, how do I make it one? Edited May 29, 2004 by SweatyOgre Link to comment Share on other sites More sharing options...
CyberSlug Posted May 29, 2004 Share Posted May 29, 2004 (edited) Try this: $XY = PixelSearch(314, 192, 507, 389, 0x7898D8) $err = @error Sleep(3500) If Not $err Then MouseClick("left",$XY[0],$XY[1], 1, 0) Your problem is that the value of the @error flag is reset to zero after the sleep statement (successfully) runs. Consequently, your If-Then test will always evaluate to true regardless of if the PixelSearch was successful. I think @error trips up everyone at some point--so welcome to the club Backup the value of @error if you do not use it right away! Edited May 29, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! 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