Sign in to follow this  
Followers 0
TheTester

Simple pixelsearch

5 posts in this topic

$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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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...
EndIf

Or simpler:

$coord = PixelSearch(464, 306, 468, 306, 0xFFFFFF)
If Not @error Then MouseMove($coord[0], $coord[1])
Edited by Ramzes

Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font]

Share this post


Link to post
Share on other sites

Asuming I mousemove into the pixel,what do I do next?

Share this post


Link to post
Share on other sites

What do you want to do?


Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font]

Share this post


Link to post
Share on other sites

Check if a (series of) white pixel(s) is in that area,then mouseclick in the position of the pixel.

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