Hi,
I'm trying to write a script that presses n repeatedly very quickly like 0ms delay (is this possible? Or must it be 1ms delay)
The game I'm playing only registers when you press n manually (key going up and down).
totally new to this autohotkey thing, only discovered it today! (yes i'm slow)
Any help will be greatly appreciated!!!
Trying to make a script that presses letter n repeatedly
Re: Trying to make a script that presses letter n repeatedly
Welcome to this AutoHotkey forum!
Code: Select all
#Requires AutoHotkey v2.0
$n:: {
Static on := False, go := () => SendEvent('n')
SetTimer go, on ^= True
}
-
- Posts: 3
- Joined: 20 Jan 2024, 08:09
- Contact:
Re: Trying to make a script that presses letter n repeatedly
;how much memory you got? all those key presses gotta go somewhere. clog your buffer and ;other things to think about but
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code!]
;checks if n is Physically held down.
;theres better ways (i started learning a couple days ago) but this simple setup ive had the most ;success
;IMPORTANT
;if doesnt work but opening .ahk and testing keyfunction produces no errors:convert to exe and run ;as admin
Code: Select all
#Requires AutoHotkey v2.0
Persistent
#SingleInstance Force
; .1seconds better off around 300ms but gotta figureout what best for ;you+system inside game
SetTimer spam, 100
spam() {
If GetKeyState("n", "P") {
While GetKeyState("n", "P") {
Sendinput "n"
}
Return
}
}
;checks if n is Physically held down.
;theres better ways (i started learning a couple days ago) but this simple setup ive had the most ;success
;IMPORTANT
;if doesnt work but opening .ahk and testing keyfunction produces no errors:convert to exe and run ;as admin
Who is online
Users browsing this forum: No registered users and 4 guests