Jump to content

ImageSearch finds picture once but not twice or more


Recommended Posts

Hello there, 

I am currently using ImageSearch UDF Version 2021.8.30.1AutoIt 3.3.16.0 on a Windows 11 machine. With the code shown below, I am able to move my mouse to the picture I search "picture.bmp" without a problem. If I start the script again with no changes in the script, it will not find the same picture again until, I restart the PC or re open the window with the picture in it. I want to search the picture x times and sometimes twice in a row. I thought about a cache problem, but didn't found any topics about that. Any ideas?

I am using AutoIt not for the first time but I am still a beginner, go easy on me 🙌

Local $_Image_1 = @ScriptDir & "\images\picture.bmp"
Local $return = _ImageSearch($_Image_1)
    If $return[0] = 1 Then
        $return[0] = 0
        MouseMove($return[1], $return[2])
    EndIf

 

Link to comment
Share on other sites

14 hours ago, junkew said:

How and when is the picture.bmp created? 

Did you do a pixel compare if its based on screenshots from different pointe in time?

The picture.bmp does always exist. I took a screenshot and saved the file as .bmp. The picture.bmp is not created with the script.

I did a pixel compare after it is found, the pixel does not change.

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

×
×
  • Create New...