how to click beside a iamge Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jojo95752003
Posts: 8
Joined: 13 Feb 2018, 23:10
Contact:

how to click beside a iamge

18 Feb 2018, 06:49

hello!
i have been using imagesearch for a few days, and i have a question here
F4::
imagesearch, x, y, 0, 0, A_screenwidth, A_screenheight, file.png
; msgbox, %x%, %y%
mouseclick, left, %x%, %y%
return

this is my script and my script can find my picture very well, however my mouse just doesnt click where i want
the cursor always clicks at the left-up corner of the png picture. it just never click right in the middle of the png picture as i want

my question is ... is there any way to solve my problems like adding numbers onto the x and y mouseclick, left, %x%+2, %y%+2 ?

thank you so much for reading my question!!
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: how to click beside a iamge  Topic is solved

18 Feb 2018, 07:36

You can try force expression for this command, like this:

Code: Select all

mouseclick, left, % x+2, % y+2
If it doesn't work - simply overwrite the variables with your offset before the command:

Code: Select all

imagesearch, x, y, 0, 0, A_screenwidth, A_screenheight, file.png
x += 2
y += 2
mouseclick, left, %x%, %y%
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: alawsareps, Joey5, mebelantikjaya, mikeyww and 311 guests