if Lmouseclick then double tap A on keyboard

Ask gaming related questions (AHK v1.1 and older)
Blossom
Posts: 10
Joined: 19 Sep 2022, 12:41

if Lmouseclick then double tap A on keyboard

Post by Blossom » 02 Oct 2022, 09:21

Hey guys!

i'm looking to make this script a little better if anyone can help me out..
So what i'm looking to do is when i press left mouse button, it double taps A on the keyboard ( to quickswitch my weapon).
i'm currently working with this:

~LButton::
Sleep 200
Send A
Send A
Return

What i would like it to do is:

- also work when i'm holding ALT or CTRL.
- A pauze/start button so i can pauze the script when i'm in the lobby and it doesnt spam A everytime i click something.

If anyone could help me out i would be grateful!
thanks!
-

Blossom
Posts: 10
Joined: 19 Sep 2022, 12:41

Re: if Lmouseclick then double tap A on keyboard

Post by Blossom » 02 Oct 2022, 09:36

Alright managed to work in a pauze in the script so that's good.

I now have another question. How can i automatically pauze the script when i scroll the mousewheel down and unpauze when i scroll the mousewheel up?
and how do i add a beep sound to the script so i know when its pauzed/unpauzed.
and ofcourse how do i make sure the script also works when i press ALT or CTRL.

a whole bunch of questions lol.. i'll keep looking in the meanwhile.
thanks!

User avatar
mikeyww
Posts: 26947
Joined: 09 Sep 2014, 18:38

Re: if Lmouseclick then double tap A on keyboard

Post by mikeyww » 02 Oct 2022, 09:40

Code: Select all

Gosub, F3

F3::
on := !on
SoundBeep, 1000 + 500 * on
Return

#If on
~LButton::
~!LButton::
~^LButton::
Sleep, 200
Send aa
Return
#If

Blossom
Posts: 10
Joined: 19 Sep 2022, 12:41

Re: if Lmouseclick then double tap A on keyboard

Post by Blossom » 02 Oct 2022, 09:48

mikeyww wrote:
02 Oct 2022, 09:40

Code: Select all

Gosub, F3

F3::
on := !on
SoundBeep, 1000 + 500 * on
Return

#If on
~LButton::
~!LButton::
~^LButton::
Sleep, 200
Send aa
Return
#If
So i just add this to my script?

Blossom
Posts: 10
Joined: 19 Sep 2022, 12:41

Re: if Lmouseclick then double tap A on keyboard

Post by Blossom » 02 Oct 2022, 09:51

this works great you code wizard!! thank you so much.

Do you have any idea if it's possible to pauze the script aswell when i mousewheel scroll down and unpause when i mousewheel scroll up?

User avatar
mikeyww
Posts: 26947
Joined: 09 Sep 2014, 18:38

Re: if Lmouseclick then double tap A on keyboard

Post by mikeyww » 02 Oct 2022, 10:27

Code: Select all

Gosub, F3
F3::        on := on(on := !on) ; F3        = Toggle
~WheelDown::on := on(False)     ; WheelDown = "Pause"
~WheelUp::  on := on()          ; WheelUp   = Resume

#If on
~LButton::
~!LButton::
~^LButton::
Sleep, 200
Send aa
Return
#If

on(tf := True) {
 SoundBeep, 1000 + 500 * tf
 Return tf
}

Post Reply

Return to “Gaming Help (v1)”