Jump to content

Please help me correct this

Recommended Posts

Guest RobK60

This bit of code doesnt seem to be working properly... what i want it to do is search through the rectangle to look for a certain color. and click it ... the object moves thus the reason for doing it 4 times it ensures that the object gets clicked.

It seems to work.....untill the second time through the loop it will give me the error code: subscript used with non-array variable.

I dont understand... your help is appreciated

while 1

$a= PixelSearch(44,257,486,272,0x00FFFF)

$b= PixelSearch(46,257,486,272,0x00FFFF)

$c= PixelSearch(45,257,486,272,0x00FFFF)

$e= PixelSearch(42,257,486,272,0x00FFFF)

Link to post
Share on other sites

Your mouse clicks assume that PixelSearch returns an array. However, if PixelSearch only returns an array if the color is found! (The help file says that PixelSearch returns numeric 1 and sets @error to 1 if it "fails.")

Try something like this:

$a= PixelSearch(44,257,486,272,0x00FFFF)
If IsArray($a) Then mouseclick("left",$a[0],$a[1])
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 post
Share on other sites
Guest RobK60

Ok now its not saying its an array...so most likely is not finding the color, when doing pixel search for the 4 variables right left bottom and top should i be using the X vars on the window spy util to determine the area to search? im not clear on how that works

this is how i have it set up now using only X vars PixelSearch(44,257,486,272,0x00FFFF) what is it i should be doing? my whole screen?

Edited by RobK60
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...