Help with this simple script please

Ask gaming related questions (AHK v1.1 and older)
jfbreez
Posts: 2
Joined: 03 Jun 2020, 17:56

Help with this simple script please

03 Jun 2020, 18:01

Hello i am playing a video game and i need press botton "q" as fast as possible constantly.

Can you help me?
Thanks.
Hackerxd
Posts: 10
Joined: 05 Apr 2020, 15:39

Re: Help with this simple script please

11 Jun 2020, 14:28

To just press a key you would use Send, see https://www.autohotkey.com/docs/commands/Send.htm
Example:

Code: Select all

Send, {q down}
Send, {q up}
To have some control over it:

Code: Select all

a::
	Loop, 20 ; Number of repeats
	{
		SendInput, {q down} ; hold key down
		Sleep, 10 ; Optional time for the key to be held down
		SendInput, {q up} ; release the key
		Sleep, 10 ; Optional delay between each key press
	}
You can also do it in infinite loop, but controlled by pausing the script:

Code: Select all

#SingleInstance force
#MaxThreadsPerHotkey 2
ScriptActive := 0

a::
	ScriptActive := !ScriptActive
	while, ScriptActive
	{
		SendInput, {q down}
		SendInput {q up}
	}
return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 66 guests