Advertisement
Guest User

Dark Souls 2 AHK script

a guest
Jan 16th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance Force
  2. #MaxHotkeysPerInterval 99999
  3. #IfWinActive ahk_class DarkSouls2
  4.  
  5. ~MButton::Numpad8           ; Lock-on by pressing the mouse wheel
  6.  
  7. ;~WheelUp::             ; Cycle target left by scrolling up
  8. ;   Send {Numpad7 down}
  9. ;   Sleep 20
  10. ;   Send {Numpad7 up}
  11. ;return
  12.  
  13. ;~WheelDown::               ; Cycle target right by scrolling down
  14. ;   Send {Numpad9 down}
  15. ;   Sleep 20
  16. ;   Send {Numpad9 up}
  17. ;return
  18.  
  19. ~RButton::Numpad4           ; Right mouse button for left hand light attack
  20. ~Tab::Numpad5               ; Tab for left strong attack (awkward when attacking with a left-hand weapon, but using the code below would cause a parry on hold)
  21.  
  22. ~LButton::
  23.     if (keyState)           ; If you hold down a keyboard key, it repeatedly fires the hotkey       <- Not my text btw
  24.         return          ; This will mess up our logic, so we need to disable it
  25.     keyState := 1           ; Register key as being currently held, so we can filter repeats
  26.     SetTimer, DoLongPress, -100 ; Start the long-press timer running (Negative number means "Fire only once")
  27.     lpTime := A_TickCount + 100 ; Calculate the time at which the short-press window ends
  28.     return
  29.  
  30. ~LButton up::
  31.     SetTimer, DoLongPress, Off  ; Disable the long press timeout                        <- Also not mine lol am too stupid to code
  32.     keyState := 0           ; Unregister key as being held
  33.     if (A_TickCount < lpTime){  ; Was the key released before the long press timeout expired?
  34.         gosub, DoShortPress ; Yes - fire the short press
  35.     }
  36. return
  37.  
  38. DoShortPress:               ; Light press on LMB causes a right hand light attack
  39.     Send {Numpad1 down}     ; Both also fuck up clicking on the keybinding menu, so watch it and use the keyboard to select things instead
  40.     Sleep 20
  41.     Send {Numpad1 up}
  42. return
  43.  
  44. DoLongPress:                ; Hold on LMB causes a right hand heavy attack after the adjustable timer above
  45.     Send {Numpad2 down}     ; Do keep in mind it does the same for ranged weapons
  46.     Sleep 20
  47.     Send {Numpad2 up}
  48. return
  49.  
  50. ;~LShift & LButton::Numpad2
  51. ;~LShift & RButton::Numpad5
  52.  
  53.                     ; Interaction for interact and accept on same key, only sends once when holding (interaction bound to T)
  54. ~T::
  55.     if suppress
  56.         return
  57.     Send {Enter down}
  58.     Sleep 20
  59.     Send {Enter up}
  60.     suppress :=1
  61. return
  62.  
  63. ~T Up::
  64.     suppress := 0
  65. return
  66.  
  67. Q::                 ; Going back on menus with Q, can send several times per second and be used to confirm keybindings instead of mashing backspace
  68.     Send {Backspace down}
  69.     Sleep 20
  70.     Send {Backspace up}
  71. return
  72.  
  73. Space::                 ; Roll once, independent of tapping or holding space
  74.     if suppress
  75.         return
  76.     Send {Space down}
  77.     Sleep 20
  78.     Send {Space up}
  79.     suppress :=1
  80. return
  81.  
  82. Space up::
  83.     suppress := 0
  84. return
  85.  
  86. LShift::Space               ; Dash with shift (dash still bound to spacebar, very poggers), but unfortunately also roll with shift
  87.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement