Toggling on and off Topic is solved

Ask gaming related questions
Kriczeq

Toggling on and off  Topic is solved

03 Oct 2018, 16:36

I have problem with turning on and off my script. I can only turn on and i cant stop with hotkey after that.
I want to have toogle on and off on the same button(f6 button). This is my script.

Code: Select all

f6::

{
   send {e}
   sleep 1000
   send {e}
   sleep 1000
   send {e}
   sleep 1000
}
return
User avatar
Onimuru
Posts: 41
Joined: 08 Sep 2018, 18:35
GitHub: Onimuru

Re: Toggling on and off

04 Oct 2018, 00:22

Toggle an infinite loop on/off:

Code: Select all

F6::SetTimer, Toggle_Loop, % ((Toggle_Variable := !Toggle_Variable) ? "On" : "Off")

Toggle_Loop:
	Send e
	Sleep 1000
	Return
Toggle actions on press:

Code: Select all

F6::
	If !Toggle_Variable
	{
		[First time pressed code]
	}
	Else
	{
		[Second time pressed code]
	}
	Toggle_Variable := !Toggle_Variable
	Return

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 54 guests