Please help with "On" "Off" Macro

Ask gaming related questions
Canibus3
Posts: 2
Joined: 20 Jul 2020, 16:00

Please help with "On" "Off" Macro

Post by Canibus3 » 20 Jul 2020, 16:08

Code: Select all

HotKey, LButton, Off ;Initially, the Fast Fire part is deactivated
Return ;End of Auto-execute Section https://autohotkey.com/docs/Scripts.htm#auto
/::suspend
F8::Hotkey, LButton, % (Toggle := !Toggle) ? "On" : "Off"
LButton:: ;Fast Fire part
SetMouseDelay 20
While GetKeyState("LButton","P")
Click
Return

-- I use this script for Rapid LButton clicks but I want to add 3 other buttons that will turn it "On" and 1 other button that will turn it "Off".

For example: When I press "9" it will turn it off or pause it (whatever is faster).
When I press "0,1,2" it will turn it "On"

Please any help! Thank you
Last edited by BoBo on 20 Jul 2020, 17:09, edited 1 time in total.
Reason: Moved to Gaming section. Added [code][/code]-tags.
Canibus3
Posts: 2
Joined: 20 Jul 2020, 16:00

Re: Please help with "On" "Off" Macro

Post by Canibus3 » 20 Jul 2020, 22:46

Code: Select all

HotKey, LButton, Off ;Initially, the Fast Fire part is deactivated
Return ;End of Auto-execute Section https://autohotkey.com/docs/Scripts.htm#auto
/::suspend
F8::Hotkey, LButton, % (Toggle := !Toggle) ? "On" : "Off"
9::Hotkey, LButton, % (Toggle := !Toggle) ? "Off" : "Off"
0::Hotkey, LButton, % (Toggle := !Toggle) ? "On" : "On"
1::Hotkey, LButton, % (Toggle := !Toggle) ? "On" : "On"
2::Hotkey, LButton, % (Toggle := !Toggle) ? "On" : "On"
LButton:: ;Fast Fire part
	SetMouseDelay 20
	While GetKeyState("LButton","P")
		Click
Return
[Mod edit: [code][/code] tags added.]


I tried this and it worked BUT the keys seem to be deactivated, when I press 9,0,1 or 2 in Notepad for example they do not work. It's like the keys are reserved for the Toggle.
serverleader
Posts: 1
Joined: 20 Jan 2021, 16:16

Re: Please help with "On" "Off" Macro

Post by serverleader » 21 Jan 2021, 18:28

if you add ~ infront it will pass the keys like:
Canibus3 wrote:
20 Jul 2020, 22:46

Code: Select all

HotKey, LButton, Off ;Initially, the Fast Fire part is deactivated
Return ;End of Auto-execute Section https://autohotkey.com/docs/Scripts.htm#auto
/::suspend
~F8::Hotkey, LButton, % (Toggle := !Toggle) ? "On" : "Off"
~9::Hotkey, LButton, % (Toggle := !Toggle) ? "Off" : "Off"
~0::Hotkey, LButton, % (Toggle := !Toggle) ? "On" : "On"
~1::Hotkey, LButton, % (Toggle := !Toggle) ? "On" : "On"
~2::Hotkey, LButton, % (Toggle := !Toggle) ? "On" : "On"
LButton:: ;Fast Fire part
	SetMouseDelay 20
	While GetKeyState("LButton","P")
		Click
Return
[Mod edit: [code][/code] tags added.]


I tried this and it worked BUT the keys seem to be deactivated, when I press 9,0,1 or 2 in Notepad for example they do not work. It's like the keys are reserved for the Toggle.
Post Reply

Return to “Gaming”