TheTester Posted October 18, 2011 Posted October 18, 2011 $coord = PixelSearch( 464,306, 468, 306, 0xFFFFFF ) ; Checks for a white pixel in these coord If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) elseif @error MsgBox(0, "Error found!", "Nothing white here") Endif And I can't understand the error I get (probably when it doesn't find a white pixel): Subscript used with non-Array variable.: Mousemove($coord[0],$coord[1]) Mousemove($coord^ ERROR >Exit code: 1 Time: 4.819 Am I making a mistake in [left, top, right, bottom] syntax?Or is it something else? Thanks in advance
Ramzes Posted October 18, 2011 Posted October 18, 2011 (edited) If PixelSearch doesn't find function returns 0 (not array).You should use MouseMove in If... EndIf:$coord = PixelSearch(464, 306, 468, 306, 0xFFFFFF) If Not @error Then MouseMove($coord[0], $coord[1]) ;Code... EndIfOr simpler:$coord = PixelSearch(464, 306, 468, 306, 0xFFFFFF) If Not @error Then MouseMove($coord[0], $coord[1]) Edited October 18, 2011 by Ramzes Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font]
TheTester Posted October 19, 2011 Author Posted October 19, 2011 Asuming I mousemove into the pixel,what do I do next?
Ramzes Posted October 19, 2011 Posted October 19, 2011 What do you want to do? Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font]
TheTester Posted October 19, 2011 Author Posted October 19, 2011 Check if a (series of) white pixel(s) is in that area,then mouseclick in the position of the pixel.
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