Need help for creating a simple script Topic is solved

Ask gaming related questions (AHK v1.1 and older)
monkey_squad
Posts: 4
Joined: 24 Mar 2017, 08:42

Need help for creating a simple script

24 Mar 2017, 10:07

Hello,

I'm in need of a script which does following:

if I press RMouse:

- RMouse Down
- RMouse Up
- RMouse Down
- keep RMouse down until I release RMouse.

So basiclly a double right click, but the RMouse only goes up again when I release it.

I think the code could look something like this: (never coded anything with AHK, so I'm just guessing)

if("RightMouseClick") //I will be holding down RMouse
{
"RightMouseUp";
"RightMouseDown";
} //So now because I was holding down RMouse, it will register RightMouseUp when I release it, right? :^)

To give some context for what I need this script:
In the game Battleground, in order to ADS temporary you need to double click and hold RMouse. Now I'm looking for a way to automaticly do this second click, so that I can just hold RMouse und still go ADS.

I hope I didn't repeat my self too often and did describe my problem understandable.

Greetings
monkey_squad
Posts: 4
Joined: 24 Mar 2017, 08:42

Re: Need help for creating a simple script

24 Mar 2017, 16:16

Can someone pls help me?

I tried following script, but it doesn't seem to work:

if (Click down right)
{
Click up right
Click down right
}

I never used AHK and there is way to much content in the AutoHotkey Help for me to figure out how to do this. :^(
CrescentSurfer
Posts: 10
Joined: 21 Mar 2017, 22:56

Re: Need help for creating a simple script  Topic is solved

25 Mar 2017, 03:38

Tell me if this code works for you

Code: Select all

$LButton::
{
	Click
	Click Down
	
	while getkeystate("LButton","P")
	{
	}
	
	Click Up
	return
}
monkey_squad
Posts: 4
Joined: 24 Mar 2017, 08:42

Re: Need help for creating a simple script

25 Mar 2017, 09:34

Thank you so much! Works perfectly!
bluce
Posts: 70
Joined: 01 Feb 2017, 13:23

Re: Need help for creating a simple script

27 Mar 2017, 08:42

CrescentSurfer wrote:

Code: Select all

	while getkeystate("LButton","P")
	{
	}
For future reference, instead of using a while loop you can simply use KeyWait LButton which is a neater way of waiting for the user to release LButton.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: jameswrightesq and 161 guests