tabnation

rapid fire ahk v1 v2

Jun 22nd, 2026
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. AHK V1
  2.  
  3. #NoEnv
  4. #SingleInstance Force
  5. SendMode Input
  6. SetBatchLines, -1
  7.  
  8. ; =========================
  9. ; SETTINGS
  10. ; =========================
  11. delay := 30
  12.  
  13. ; =========================
  14. ; STATE
  15. ; =========================
  16. isOn := false
  17. firing := false
  18.  
  19. ; =========================
  20. ; SAFETY EXIT
  21. ; =========================
  22. F1::ExitApp
  23.  
  24. ; =========================
  25. ; TOGGLE
  26. ; =========================
  27. F6::
  28. isOn := !isOn
  29. ToolTip, % isOn ? "Rapid Fire: ON" : "Rapid Fire: OFF"
  30. SetTimer, RemoveToolTip, -800
  31. return
  32.  
  33. RemoveToolTip:
  34. ToolTip
  35. return
  36.  
  37. ; =========================
  38. ; START FIRING
  39. ; =========================
  40. ~*LButton::
  41. if (!isOn)
  42. return
  43.  
  44. firing := true
  45.  
  46. while (firing && GetKeyState("LButton", "P"))
  47. {
  48. ; Send DOWN/UP manually for tighter control
  49. SendInput, {LButton down}
  50. Sleep, 5
  51. SendInput, {LButton up}
  52.  
  53. ; micro-break so it can detect release faster
  54. Sleep, %delay%
  55. }
  56. return
  57.  
  58. ; =========================
  59. ; STOP FIRING INSTANTLY
  60. ; =========================
  61. ~*LButton Up::
  62. firing := false
  63.  
  64. ; FORCE release to prevent stuck/buffered clicks
  65. SendInput, {LButton up}
  66.  
  67. ; tiny pause to let input queue clear
  68. Sleep, 10
  69. return
  70.  
  71.  
  72.  
  73.  
  74.  
  75. AHK v2
  76. #Requires AutoHotkey v2.0
  77. #SingleInstance Force
  78.  
  79. ; =========================
  80. ; SETTINGS
  81. ; =========================
  82. delay := 30
  83.  
  84. ; =========================
  85. ; STATE
  86. ; =========================
  87. global firing := false
  88. global isOn := false
  89.  
  90. ; =========================
  91. ; SAFETY EXIT
  92. ; =========================
  93. F1::ExitApp()
  94.  
  95. ; =========================
  96. ; TOOLTIP HELPER
  97. ; =========================
  98. ShowTip(text) {
  99. ToolTip(text)
  100. SetTimer(() => ToolTip(), -800)
  101. }
  102.  
  103. ; =========================
  104. ; TOGGLE
  105. ; =========================
  106. F6::{
  107. global isOn
  108. isOn := !isOn
  109. ShowTip(isOn ? "Rapid Fire: ON" : "Rapid Fire: OFF")
  110. }
  111.  
  112. ; =========================
  113. ; START FIRING
  114. ; =========================
  115. ~*LButton::{
  116. global isOn, firing, delay
  117.  
  118. if (!isOn)
  119. return
  120.  
  121. firing := true
  122.  
  123. while (firing && GetKeyState("LButton", "P")) {
  124. SendInput("{LButton down}")
  125. Sleep(5)
  126. SendInput("{LButton up}")
  127.  
  128. Sleep(delay)
  129. }
  130. }
  131.  
  132. ; =========================
  133. ; STOP FIRING INSTANTLY
  134. ; =========================
  135. ~*LButton Up::{
  136. global firing
  137.  
  138. firing := false
  139.  
  140. ; force release (prevents stuck clicks)
  141. SendInput("{LButton up}")
  142.  
  143. ; small buffer clear
  144. Sleep(10)
  145. }
Advertisement
Add Comment
Please, Sign In to add comment