Guthlx

PathofExile numpad trick AHK

May 10th, 2022 (edited)
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; poe-numpad_trick.ahk
  2. ; list of keys https://www.autohotkey.com/docs/KeyList.htm
  3.  
  4. ; Most common path of exile window names
  5. GroupAdd, poe_window, ahk_exe PathOfExile.exe
  6. GroupAdd, poe_window, ahk_exe PathOfExileSteam.exe
  7. GroupAdd, poe_window, ahk_exe PathOfExile_x64.exe
  8. GroupAdd, poe_window, ahk_exe PathOfExile_x64Steam.exe
  9.  
  10. #IfWinActive ahk_group poe_window ; only activate when poe is detected
  11. #SingleInstance force ; only 1 script
  12. #warn  ; debugging
  13. #NoEnv
  14. SetKeyDelay,0
  15. SetBatchlines,-1
  16. ; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  17.  
  18. StartStop = F12 ; see top of script for keys
  19. spam_key = ; You can use any number of buttons here
  20. (
  21. Numpad1
  22. Numpad2
  23. Numpad3
  24. )
  25.  
  26. loop, parse, spam_key, % "`n" ; loop through spam_key var
  27.   Send, {%spam_key% up}     ; clears any key on script start
  28.  
  29. toggleStatus := 0 ; 0 off 1 on  ; clears vars on script start
  30.  
  31. hotkey, %StartStop%, ToggleKey, on  ; toggles keyspam
  32. ToggleKey:
  33. If( toggleStatus = 1 ){
  34.   loop, parse, spam_key, % "`n" ; loop through spam_key var
  35.     Send, {%A_LoopField% down} ; hold down each key in loop
  36.     toggleStatus = 0
  37. } Else If ( toggleStatus = 0){
  38.     Send, {%A_LoopField% up} ; release each key in loop
  39.   loop, parse, spam_key, % "`n" ; loop through spam_key var
  40.     toggleStatus = 1
  41. }
  42. Return
  43.  
  44. ; Ctrl+Alt+A -- check if script recognizes game window
  45. ^!a::
  46. WinGetTitle, titlevar, A
  47. ToolTip, active window is %titlevar%`n`nHotkeys defined:`n%spam_key%
  48. SetTimer, removetooltip, -2000
  49. return
  50.  
  51. removetooltip:
  52. Tooltip
  53. return
  54.  
Add Comment
Please, Sign In to add comment