Page 1 of 1

three ImageSearch

Posted: 23 Feb 2018, 07:21
by Lolla
Hi,

I need the script to find 3 image on the desktop... if he does not find all 3, he will still send a mouse click.
(When he finds all 3, he makes a sound announcement)

I created a script for only one image search but I do not know how to create it for three images. :headwall:

Please help me.

Re: three ImageSearch  Topic is solved

Posted: 23 Feb 2018, 15:16
by Xtra

Code: Select all

#NoEnv
SetWorkingDir %A_ScriptDir%
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen

if (MyImageSearch(0, 798, 112, 918, "test1.png") and MyImageSearch(57, 995, 177, 1115, "test2.png") and MyImageSearch(0, 1003, 109, 1123, "test3.png"))
    SoundPlay, *48
else
    Click, 0, 0

MyImageSearch(X1, Y1, X2, Y2, ImageFile)
{
    ImageSearch,,, X1, Y1, X2, Y2, %ImageFile%
    if (ErrorLevel = 0)
        return true
    return false
}
Change search coords, image names and click coords to your values.

HTH

Re: three ImageSearch

Posted: 26 Feb 2018, 06:14
by Lolla
Thank you very much! Work me :dance: