Restart a script with a pressed keybind Topic is solved

Ask gaming related questions (AHK v1.1 and older)
MatrixMaster543
Posts: 10
Joined: 18 Jun 2022, 13:26

Restart a script with a pressed keybind

Post by MatrixMaster543 » 25 Jun 2022, 17:01

Hello, guys I need help with writing a script where I only want to run this sequence once then restart it by pressing shift.

Here is the script that I want it to act like that:

Code: Select all

Lbutton::
Send, {1}{Lbutton}
return



I

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

Re: Restart a script with a pressed keybind

Post by mikeyww » 25 Jun 2022, 21:18

Code: Select all

Gosub, Shift
Shift::Send 1{LButton}

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Restart a script with a pressed keybind  Topic is solved

Post by Rohwedder » 26 Jun 2022, 00:40

Hallo,
or (your wish is ambiguous):

Code: Select all

#IF !AlreadyRun
Lbutton::Send,% (AlreadyRun:=1) "{LButton}"
#IF
~*Shift::AlreadyRun:=0
or:

Code: Select all

Lbutton::
Send, {1}{Lbutton}
Hotkey,% A_ThisHotkey, Off
Return
~*Shift::Reload

Post Reply

Return to “Gaming Help (v1)”