Advertisement
t3h_m00kz

WheelUp.ahk

Mar 6th, 2022
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Fix for accidental weapon switches
  2. ; and mouse wheel inputs:
  3. ; Add delays between inputs,
  4. ; longer delay if twice (YY)
  5.  
  6. #Include Init.ahk
  7.  
  8. #If WinActive("ahk_exe HaloInfinite.exe")
  9.  
  10. ;Mouse wheel up plus wildcard modifier plus do not suppress
  11. ~*WheelUp::
  12.     switchWeapon() 
  13.     cooldownCheck()
  14.     return
  15.  
  16. ;Weapon switch input
  17. switchWeapon(){
  18.     send {blind}{u up}
  19.     sleep 1
  20.     send {blind}{u down}
  21.     sleep 1
  22.     send {blind}{u up}
  23.  
  24.     Sleep 55 ;stock cooldown
  25.  
  26.     return
  27.     }
  28.  
  29. ;Check if second switch is fast enough to need an extended cooldown (YY)
  30. cooldownCheck(){
  31.     if (A_PriorHotkey = "~*WheelUp" and A_TimeSincePriorHotkey < 275)
  32.         {
  33.             ;run sound_test_1.ahk
  34.             Sleep 250
  35.             return
  36.         }
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement