chessmaster Posted March 18, 2010 Posted March 18, 2010 Hello, You guys seem to get asked this question a lot, and i've read all related search results within the forum, but I simply cannot get this to work! I'm trying to make my script locate a certain color within a predefined set of coords, and then click said color, but I keep receiving an error message. Here's the line of code in question: $coord = PixelSearch( 830, 0, 1076, 832, 0xFEFEFE) If Not @error Then MouseClick ("left", $ArrowClick[0], $ArrowClick[1]) EndIf Here's the error message I'm receiving: $coord = PixelSearch( 830, 0, 1076, 832, 0xFEFEFE) ^ERROR Error: Variable used without being declared. I pretty much copy/pasted this straight from the help file, and edited the parameters for my own needs, but it's still giving me this message. Any and all help is greatly appreciated, thank you!
somdcomputerguy Posted March 18, 2010 Posted March 18, 2010 You need to declare $coord. Change this line of code from $coord = PixelSearch( 830, 0, 1076, 832, 0xFEFEFE) to Local $coord = PixelSearch( 830, 0, 1076, 832, 0xFEFEFE). That variable may need to be defined as Global, instead of Local, but not seeing all the code you have makes it difficult to determine whether or not so. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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