Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AHK V1
- #NoEnv
- #SingleInstance Force
- SendMode Input
- SetBatchLines, -1
- ; =========================
- ; SETTINGS
- ; =========================
- delay := 30
- ; =========================
- ; STATE
- ; =========================
- isOn := false
- firing := false
- ; =========================
- ; SAFETY EXIT
- ; =========================
- F1::ExitApp
- ; =========================
- ; TOGGLE
- ; =========================
- F6::
- isOn := !isOn
- ToolTip, % isOn ? "Rapid Fire: ON" : "Rapid Fire: OFF"
- SetTimer, RemoveToolTip, -800
- return
- RemoveToolTip:
- ToolTip
- return
- ; =========================
- ; START FIRING
- ; =========================
- ~*LButton::
- if (!isOn)
- return
- firing := true
- while (firing && GetKeyState("LButton", "P"))
- {
- ; Send DOWN/UP manually for tighter control
- SendInput, {LButton down}
- Sleep, 5
- SendInput, {LButton up}
- ; micro-break so it can detect release faster
- Sleep, %delay%
- }
- return
- ; =========================
- ; STOP FIRING INSTANTLY
- ; =========================
- ~*LButton Up::
- firing := false
- ; FORCE release to prevent stuck/buffered clicks
- SendInput, {LButton up}
- ; tiny pause to let input queue clear
- Sleep, 10
- return
- AHK v2
- #Requires AutoHotkey v2.0
- #SingleInstance Force
- ; =========================
- ; SETTINGS
- ; =========================
- delay := 30
- ; =========================
- ; STATE
- ; =========================
- global firing := false
- global isOn := false
- ; =========================
- ; SAFETY EXIT
- ; =========================
- F1::ExitApp()
- ; =========================
- ; TOOLTIP HELPER
- ; =========================
- ShowTip(text) {
- ToolTip(text)
- SetTimer(() => ToolTip(), -800)
- }
- ; =========================
- ; TOGGLE
- ; =========================
- F6::{
- global isOn
- isOn := !isOn
- ShowTip(isOn ? "Rapid Fire: ON" : "Rapid Fire: OFF")
- }
- ; =========================
- ; START FIRING
- ; =========================
- ~*LButton::{
- global isOn, firing, delay
- if (!isOn)
- return
- firing := true
- while (firing && GetKeyState("LButton", "P")) {
- SendInput("{LButton down}")
- Sleep(5)
- SendInput("{LButton up}")
- Sleep(delay)
- }
- }
- ; =========================
- ; STOP FIRING INSTANTLY
- ; =========================
- ~*LButton Up::{
- global firing
- firing := false
- ; force release (prevents stuck clicks)
- SendInput("{LButton up}")
- ; small buffer clear
- Sleep(10)
- }
Advertisement
Add Comment
Please, Sign In to add comment