Need help on a script

Ask gaming related questions (AHK v1.1 and older)
R3con
Posts: 6
Joined: 24 Sep 2017, 11:05

Need help on a script

20 Nov 2017, 05:14

Hello,
I am trying to make a litlle scirpt, but I need help.
I want that holding right mouse would HOLD RIGHT MOUSE and HOLD LEFT SHIFT after some delay. And then I stop holding right mouse the script would end.

I try doing something like this:
*RButton::Send {RButton down}{LShift down}

But it doesnt work very good. Can you help me?
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Need help on a cript

20 Nov 2017, 05:32

Try:

*RButton::
Send {RButton down}{LShift down}
KeyWait, RButton
Send {RButton up}{LShift up}
return
Rohwedder
Posts: 7616
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need help on a cript

20 Nov 2017, 07:20

Hallo,
in a similar way but with delay:

Code: Select all

~*RButton:: ;holding right mouse would HOLD RIGHT MOUSE
Sleep, 500 ;500 ms delay
Send, {LShift down} ;HOLD LEFT SHIFT after some delay
KeyWait, RButton ;And then I stop holding right mouse
Send, {LShift up}
Return ;the thread (not the script) would end.
without delay, it is a little shorter:

Code: Select all

~RButton::LShift
R3con
Posts: 6
Joined: 24 Sep 2017, 11:05

Re: Need help on a cript

20 Nov 2017, 09:13

Rohwedder wrote:Hallo,
in a similar way but with delay:

Code: Select all

~*RButton:: ;holding right mouse would HOLD RIGHT MOUSE
Sleep, 500 ;500 ms delay
Send, {LShift down} ;HOLD LEFT SHIFT after some delay
KeyWait, RButton ;And then I stop holding right mouse
Send, {LShift up}
Return ;the thread (not the script) would end.
without delay, it is a little shorter:

Code: Select all

~RButton::LShift
Thank you. This is working very well. I wanted it for PUBG game so that I could automatically hold breath while aiming :)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Shoobis and 42 guests