Jump to content

What the hell?


Recommended Posts

Grrrr, I get this error every time i run my script.

Posted Image

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 by SweatyOgre
Link to comment
Share on other sites

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 :D Backup the value of @error if you do not use it right away!

Edited 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

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