probably simple

Ask gaming related questions (AHK v1.1 and older)
Blackendlyre
Posts: 6
Joined: 23 Oct 2017, 11:25

probably simple

23 Oct 2017, 11:31

hi.

Im asking if someone can give me a script for a keyboard key to right click then search an image that could appear anywhere on the screen (must right click first) and then left click on that image has to be a pretty quick motion to. Thanks if anyone can help.

-Press Keyboard key

which on its own will right click find the target image and then left click on it.

thx
crackint
Posts: 25
Joined: 07 Sep 2017, 18:32

Re: probably simple

23 Oct 2017, 13:09

What image? The image you right clicked on? do you have the base image already?
Blackendlyre
Posts: 6
Joined: 23 Oct 2017, 11:25

Re: probably simple

23 Oct 2017, 13:58

crackint wrote:What image? The image you right clicked on? do you have the base image already?
yeah i have it already the image, just need to know how i do it, dont know a gr8 deal about ahk :p
Blackendlyre
Posts: 6
Joined: 23 Oct 2017, 11:25

Re: probably simple

23 Oct 2017, 14:03

Blackendlyre wrote:
crackint wrote:What image? The image you right clicked on? do you have the base image already?
yeah i have it already the image, just need to know how i do it, dont know a gr8 deal about ahk :p
So if i rightclick anywhere on the page it will immediately find an image and hover it and then left click, the left click isnt neccassary i can do that myself but the right click is important for what i need :)
both is a bonus
crackint
Posts: 25
Joined: 07 Sep 2017, 18:32

Re: probably simple

23 Oct 2017, 15:09

Code: Select all

RButton::
    ImageSearch, fX, fY, 0, 0, 1920, 1080, "C:\Users\me\img.png"
 If ErrorLevel = 0
    	Click, %fX%, %fY%
    If ErrorLevel
    	Return
	Return
Something like that?
Blackendlyre
Posts: 6
Joined: 23 Oct 2017, 11:25

Re: probably simple

23 Oct 2017, 15:38

crackint wrote:

Code: Select all

RButton::
    ImageSearch, fX, fY, 0, 0, 1920, 1080, "C:\Users\me\img.png"
 If ErrorLevel = 0
    	Click, %fX%, %fY%
    If ErrorLevel
    	Return
	Return
Something like that?
I think that looks good, if i want a key to function to do all of it including the right click would it start for example

x:: then everything u typed? because i want a key to right click aswell because i'll need my right click on mouse to not be linked to the script
crackint
Posts: 25
Joined: 07 Sep 2017, 18:32

Re: probably simple

23 Oct 2017, 15:48

Yes, so...

Code: Select all

F1::
Mouseclick, right
ImageSearch, fX, fY, 0, 0, 1920, 1080, "C:\Users\me\img.png"
If ErrorLevel = 0
Click, %fX%, %fY%
If ErrorLevel
    	Return
Blackendlyre
Posts: 6
Joined: 23 Oct 2017, 11:25

Re: probably simple

23 Oct 2017, 16:18

Thats it! tyvm works fine.. One little picky thing if i could change it, when i do it and the mouse lowers onto the image it is fast but it looks kinda fake. If i was using it in a game situation because it jumps diagonally down to the picture, anyway i could have it simple lower the mouse in a straight line down to click on it? because atm it doesnt matter if my mouse is directly above it when i press the key, it still falls diagonally I can show what i mean if you want with a GIF or lil video, prob gonna sleep for tonight but tysm for ur help :)
crackint
Posts: 25
Joined: 07 Sep 2017, 18:32

Re: probably simple

23 Oct 2017, 16:50

gif/vid would help lad.
Blackendlyre
Posts: 6
Joined: 23 Oct 2017, 11:25

Re: probably simple

24 Oct 2017, 08:50

crackint wrote:gif/vid would help lad.
hey bud have pmed u a gif :) notice how the mouse flys left on the option

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 50 guests