Jump to content
Sign in to follow this  
nick21

pixel search question

Recommended Posts

nick21

Ok here is the code I am using right now

While 1
$coord = PixelSearch( 0, 0, 1023, 1023, 0X4CF44C)
If Not @error Then
    MouseClick("middle",$coord[0],$coord[1],1,0)    
EndIf
WEnd

I was wondering I can get it to find the color and click, that is not the problem but I was wondering if it is possibe to find search 2 spots at the same time and only click when the 2 colors are so close.

meaning like this:

Posted Image

Have it only click one of the 2 green squares as they are the ones close together, and not click the other green squares, until it finds 2 green squares together again(the purple dots are just for show)

any help would be great, thanks

nick21

Share this post


Link to post
Share on other sites
exodius

When you start saying you'd like it to do the same function twice, at the same time, it seems a lot like you'd like your script to do multi-threading, which AutoIt can't do... Couldn't you just do the two searches sequentially, compare the first to the second and only click if it's within the threshold you specify?

Share this post


Link to post
Share on other sites
nick21

yeah that might work, but I would have to read up on it as I don't know alot about autoit yet.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.