Jump to content

Imagesearch help


Adergon
 Share

Recommended Posts

Hey all,

Recently started using imagesearch, thought it would be interesting (not) lol.

Anyways, i got a little problem.

#include <ImageSearch.au3>
$x1=0
$y1=0
$result= _ImageSearch("recycle.bmp",1,$x1,$y1,125)
If $result=1 Then
MouseMove($x1,$y1,3)
sleep(500)
MouseClick("left")
EndIf

that's my code. It does find the recycle bin, BUT. sometimes the script clicks something random on my desktop. and not the recycle bin even when its visible. I don't udnerstand what the problem is. is it my code?

Thanks!

Link to comment
Share on other sites

How about picking a second point in the picture and checking it's color. If the second check fails, then continue searching until you get two matches.

So you mean like i add the command "else" and try again?

EDIT: could you also please post an example.

Edited by Adergon
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...