Advertisement
Acps87

AHK1

Nov 6th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. ;; by Hadronox / Rezel
  2.  
  3.  
  4. ;; ---------------------
  5. ;; INFO
  6. ;; ---------------------
  7.  
  8. ;; The purpose of this macro is to use 1 toggle key to spam 1 other key.
  9. ;; Default: "Mouse Button 4" will spam "1" at 150ms.
  10. ;; All keys are customizable along with the delays in the CONFIG section.
  11.  
  12. ;; for a list of AHK Keys: https://autohotkey.com/docs/KeyList.htm
  13.  
  14. ;; PROGRESS WINDOW: https://autohotkey.com/docs/commands/Progress.htm
  15. ;; Progress, M B1 X900 Y750 C1 W75 ZH-5 ZX0 ZY0 FM0 FS25 WM1 WS600 CT40FF06 CW000000, ON1,,ON1,Verdana
  16. ; M: movable window _ B: No border _ B1: thin border, no title bar _ B2: thick border.
  17. ; Xn/Yn coord upper left corner _ Cxy: centered sub/main text _ Wn: width client area.
  18. ; ZHn: window height/thickness _ ZXn: left/right margin _ ZYn: top/bottom margin.
  19. ; FMn: main font size, 0=10 _ FSn: sub font size, 0=8.
  20. ; WMn: main font weight _ WSn: sub font weight, 1-1000, 600=semi bold, 700=bold, 400=normal.
  21. ; CTn: color text _ CWn: color background, 16 primary HTML color names or a 6-digit RGB hex.
  22.  
  23.  
  24. ;; ---------------------
  25. ;; AUTO EXEC
  26. ;; ---------------------
  27.  
  28. #NoEnv
  29. SetWorkingDir %A_ScriptDir%
  30. SendMode Input
  31. #SingleInstance Force
  32. #MaxThreadsPerHotkey 2
  33.  
  34.  
  35. ;; ---------------------
  36. ;; CONFIG
  37. ;; ---------------------
  38.  
  39. ;; Set your DELAY, in ms.
  40. Delay := 30
  41.  
  42. ;; Set the key you want to press to start spam.
  43. KeyToPress = Numpad6 ;; MB6
  44. ; KeyToPress = NumpadMult ;; Numpad multiplication (*)
  45.  
  46. ;; Set the key you want AHK to spam.
  47. KeyToSpam = F12
  48.  
  49.  
  50. ;; ---------------------
  51. ;; MAIN
  52. ;; ---------------------
  53.  
  54. Hotkey, IfWinActive, World of Warcraft ;; enabled only in WoW
  55. Hotkey, $%KeyToPress%, Label
  56. return
  57.  
  58. Toggle := 0
  59.  
  60. Label:
  61. If(Toggle) {
  62. Toggle := 0
  63. Progress, Off
  64. SetTimer, SpamKey, Off
  65. } Else {
  66. Toggle := 1
  67. ;; PROGRESS WINDOW
  68. Progress, M B1 X1850 Y1600 C1 W70 ZH-5 ZX0 ZY0 FM0 FS35 WM1 WS600 CT40FF06 CW000000, ON,,ON,Verdana
  69. SetTimer, SpamKey, %Delay%
  70. }
  71. return
  72.  
  73. SpamKey:
  74. Send, {Blind}{%KeyToSpam%} ;; blind mode to send modifiers
  75. return
  76.  
  77.  
  78. ;; ---------------------
  79. ;; CONTROLS
  80. ;; ---------------------
  81.  
  82. ^PgDn::Suspend ;; Ctrl + PageDown to suspend script (if you want to chat)
  83. ^PgUp::Reload ;; Ctrl + PageUP to reload script
  84. ^End::ExitApp ;; Ctrl + End to terminate script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement