Page 1 of 1

Restart a script with a pressed keybind

Posted: 25 Jun 2022, 17:01
by MatrixMaster543
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

Re: Restart a script with a pressed keybind

Posted: 25 Jun 2022, 21:18
by mikeyww

Code: Select all

Gosub, Shift
Shift::Send 1{LButton}

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

Posted: 26 Jun 2022, 00:40
by Rohwedder
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