Sign in to follow this  
Followers 0
Cerb

Prob with arrays

2 posts in this topic

When I try those functions, I get an error

Heres an example

$u = PixelSearch($xstart,$ystart,$xend,$yend,$color)
While @error = 1
$u = PixelSearch($xstart,$ystart,$xend,$yend,$color)
Sleep(500)
WEnd

MouseMove($u[0],$u[1],0)
Sleep(250)
MouseClick("left")
Sleep(2500)

ERROR

Line 0:

MouseMove($u[0],$u[1],0)

MouseMove($u^ERROR

Error: Subscript used with non-Array variable.

Why?

Share this post


Link to post
Share on other sites



Ah, I think the SLEEP statement is the problem.

You are smart to check for @error in the loop; however, the sleep statement always sets the @error variable to zero. Consequently, your loop only runs once.

$u = PixelSearch($xstart,$ystart,$xend,$yend,$color)
Let errorFlag = @error

While errorFlag == 1
  $u = PixelSearch($xstart,$ystart,$xend,$yend,$color)
  errorFlag = @error
  Sleep(500)
WEnd

Suggested fix; Hope that helps


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

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