Semi to Full-Auto

Ask gaming related questions (AHK v1.1 and older)
prebombo
Posts: 2
Joined: 22 May 2022, 09:25

Semi to Full-Auto

Post by prebombo » 22 May 2022, 09:30

Code[

Code: Select all

LButton::
While GetKeyState("LButton", "P"){
	Send {p down}
	Sleep 1
	Send {p up}
}
return

o::
exitapp
return
]
"P" key is for shooting. The issue I do have with this script is that sometimes when I click for a long time my entire keyboard stops for 2 or 3 seconds. :terms:
Does any1 know why and how can I fix it? :headwall:

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: Semi to Full-Auto

Post by mikeyww » 22 May 2022, 10:12

You could increase the sleep, or add a new one after the key is released. Test in Notepad to see how it is working.

:arrow: Sleep is not precise.
Due to the granularity of the OS's time-keeping system, Delay is typically rounded up to the nearest multiple of 10 or 15.6 milliseconds (depending on the type of hardware and drivers installed). For example, a delay between 1 and 10 (inclusive) is equivalent to 10 or 15.6 on most Windows 2000/XP systems.

Code: Select all

LButton::
SetKeyDelay, 15, 20
While GetKeyState("LButton", "P")
 Send p
Return

prebombo
Posts: 2
Joined: 22 May 2022, 09:25

Re: Semi to Full-Auto

Post by prebombo » 22 May 2022, 12:48

Did not expect this replying speed, thanks!!@mikeyww

Post Reply

Return to “Gaming Help (v1)”