Help With Advanced MultImage Search Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Alec
Posts: 4
Joined: 27 Feb 2019, 18:02

Help With Advanced MultImage Search

Post by Alec » 27 Feb 2019, 18:30

I have a functional code that search for images and do some actions, but that code reach its limit, so I was looking for a different way to search for images with AHK.

The functional code is:

Code: Select all

CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 0, 0, 2350, 2350, %A_ScriptDir%\Imagens\Screen_110.png
CenterImgSrchCoords(A_ScriptDir "\Imagens\Screen_110.png", FoundX, FoundY)
If ErrorLevel = 0
{
    Goto, M01_55_110
    Return
}
The thing is that in many cases I need to search the same image in different sizes and colors, that also applies to different images, in total 948, so it’s not practical to code and search this way, too many pauses, Ifs and stuff.

That said, I’m trying to search the images using a different way, but after a lot of search I still can't t make the code work:

Code: Select all

Loop, 200
{
var += 1
    CoordMode, Pixel, Window
    ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, %A_ScriptDir%\Imagens\Screen_L1%var%.png
    CenterImgSrchCoords(A_ScriptDir "\Imagens\Screen_L1%var%.png", FoundX, FoundY)
    If var = 20
        var = 1
    If ErrorLevel = 0
    	Click, %FoundX%, %FoundY% Left, 1
    Sleep, 10
}
Until ErrorLevel = 0
Return
Can anyone help?
Any tip or help to how to solve this would be appreciated

grimboto
Posts: 53
Joined: 09 Jul 2014, 19:20

Re: Help With Advanced MultImage Search  Topic is solved

Post by grimboto » 27 Feb 2019, 19:38

the below line is an expression so change it to whats below

Code: Select all

CenterImgSrchCoords(A_ScriptDir "\Imagens\Screen_L1" . var . ".png", FoundX, FoundY)

Alec
Posts: 4
Joined: 27 Feb 2019, 18:02

Re: Help With Advanced MultImage Search

Post by Alec » 27 Feb 2019, 20:15

grimboto wrote:
27 Feb 2019, 19:38
the below line is an expression so change it to whats below

Code: Select all

CenterImgSrchCoords(A_ScriptDir "\Imagens\Screen_L1" . var . ".png", FoundX, FoundY)
Thanks for the Help!! XD

Post Reply

Return to “Ask for Help (v1)”