three ImageSearch Topic is solved

Ask gaming related questions (AHK v1.1 and older)
User avatar
Lolla
Posts: 5
Joined: 23 Feb 2018, 07:01

three ImageSearch

23 Feb 2018, 07:21

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.
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: three ImageSearch  Topic is solved

23 Feb 2018, 15:16

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
User avatar
Lolla
Posts: 5
Joined: 23 Feb 2018, 07:01

Re: three ImageSearch

26 Feb 2018, 06:14

Thank you very much! Work me :dance:

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 74 guests