How to Click below the found image (Not directly on image)

Ask gaming related questions (AHK v1.1 and older)
PeaceAlways
Posts: 3
Joined: 16 Oct 2021, 14:04

How to Click below the found image (Not directly on image)

16 Oct 2021, 14:41

Hi Guys, this is my second post here. I need to know how can we click below the image after we locate the image with Imagesearch. I do not want to click directly on the found image but below it with a gap of some pixels.

Kindly see below the initial code. After this image is found I want to click below this image after some gap.

Code: Select all

Loop, 100 
{
ImageSearch, x, y, 81, 26, 1087, 456, *75 woodegg2.png
If (ErrorLevel = 0)
	break
}

PeaceAlways
Posts: 3
Joined: 16 Oct 2021, 14:04

Re: How to Click below the found image (Not directly on image)

16 Oct 2021, 16:22

Smile_ wrote:
16 Oct 2021, 15:10
Then use MouseClick
I think Mouse click will just click directly on the image. I don't want to click on the image.

I need the click to be below the image after some distance from the image. Any ideas on how to do this?
User avatar
Smile_
Posts: 858
Joined: 03 May 2020, 00:51

Re: How to Click below the found image (Not directly on image)

17 Oct 2021, 03:12

I think Mouse click will just click directly on the image
it depends on how to use it.

Code: Select all

ImageFile := "woodegg2.png"

; This is to get the image width and height.
Gui, Add, Pic, vImg, % ImageFile
GuiControlGet, oVar, Pos, Img
Gui, Destroy
;---------------------------------------------------------------
ClickDistance := oVarH + 20

F1::
    ImageSearch, X, Y, 81, 26, 1087, 456, *75 %ImageFile%
    If (!ErrorLevel) {
        MouseClick, Left, X, Y + ClickDistance
    }
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 82 guests