Advertisement
Guest User

Auto trigger macro

a guest
Jun 27th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. #NoEnv
  2. ; Recommended for performance and compatibility with future AutoHotkey releases.
  3. SendMode Input
  4. ; Recommended for new scripts due to its superior speed and reliability.
  5. SetWorkingDir %A_ScriptDir%
  6. ; Ensures a consistent starting directory.
  7. ; The rest of these are reliability tweaks
  8. #MaxThreadsPerHotkey 2
  9. #InstallKeybdHook
  10. #UseHook On
  11.  
  12. Delay=85
  13. ; The delay between clicks, in milliseconds. Recommend not to go under 50.
  14. `:: t := !t
  15. ; Tilde toggles if 't' is true or false, false by default
  16. return
  17.  
  18. *$LShift:: Send {LShift down}
  19. *$LControl:: Send {LControl down}
  20. *$LShift Up:: Send {LShift up}
  21. *$LControl Up:: Send {LControl up}
  22. ; Because, for some reason, Control and Shift would get spammed along with LMB if pressed while the script is active.
  23.  
  24. $~*LButton::
  25. While GetKeyState("LButton","p") and (t = true)
  26. ; While toggle is on and LMB is held
  27. {
  28. Send {Click}
  29. ; Raw click sent cuz compatibility or reliability or something
  30. Sleep Delay
  31. }
  32. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement