a script that spams 1 2 and 3

Ask gaming related questions (AHK v1.1 and older)
Dorsi
Posts: 1
Joined: 04 Aug 2020, 05:17

a script that spams 1 2 and 3

Post by Dorsi » 04 Aug 2020, 05:23

Hi i need a script that spams 1 2 and 3 and by pressing p it start or stops anybody can help with this?

Sneakysnail
Posts: 44
Joined: 12 Jun 2020, 05:59

Re: a script that spams 1 2 and 3

Post by Sneakysnail » 07 Aug 2020, 04:00

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 2
#Singleinstance, Force

Toggle := False
P::
toggle := !toggle
Loop
{
	If (toggle) {
        Send {1}
	sleep 20
	Send {2}
        sleep 20
        Send {3}
	}
	Else {
		Return
	}
}
You may want to change the sleep to something slower if needed.

User avatar
Yakshongas
Posts: 590
Joined: 21 Jan 2020, 08:41

Re: a script that spams 1 2 and 3

Post by Yakshongas » 07 Aug 2020, 08:27

Is better if you use the While-Loop, like this:

Code: Select all

#MaxThreadsPerHotkey, 2
SetKeyDelay, 50, 50
Toggle := 0
P::
Toggle := !Toggle
While, (Toggle = 1)
{
    Send, 123
}
Return
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹

Post Reply

Return to “Gaming Help (v1)”