Advertisement
t3h_m00kz

AUTOHOTKEY - Halo Infinite - Negative Aim Assist Test

Mar 31st, 2022 (edited)
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ; F4 runs the script.                                     ;
  3. ; F5 refreshes the script after modifications.            ;
  4. ; Assumes 24000 dpi, 10.0 in-game sens, 0.1 V/H scale     ;
  5. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6.  
  7. ;;;;;;;;
  8. ; Init ;
  9. ;;;;;;;;
  10. SendMode, Input
  11. #InstallKeybdHook
  12. #InstallMouseHook
  13. SetWorkingDir %A_ScriptDir%
  14. SetTitleMatchMode 1
  15. SetControlDelay 1
  16. SetWinDelay 0
  17. SetKeyDelay -1
  18. SetMouseDelay -1
  19. SetBatchLines -1
  20. #MenuMaskKey vk07
  21.  
  22. ;;;;;;;;;;;;;;;;;;;
  23. ; Test case setup ;
  24. ;;;;;;;;;;;;;;;;;;;
  25. ; Variables ;
  26. ;;;;;;;;;;;;;
  27. global lookDistance := 1000     ;Distance for a full 360
  28. global zoomLevel    := 1        ;Zoom level to scale sens
  29.  
  30. ; Functions ;
  31. ;;;;;;;;;;;;;
  32.  
  33. snapSteps(distance, steps) { ; Snaps in steps
  34.     While (A_Index <= steps) {
  35.         SendMouse_RelativeMove((distance/steps), 0)
  36.         QPC_Sleep(1/steps)
  37.         }
  38.     testFire()
  39.     QPC_Sleep(1.5)
  40.     return
  41.     }
  42.  
  43. testFire()
  44.     {
  45.     send {blind}{Numpad5}
  46.     sleep 500
  47.     send {blind}{Numpad5}
  48.     sleep 500
  49.     send {blind}{k}
  50.     sleep 500
  51.     send {blind}{Numpad5}
  52.     sleep 500
  53.     send {blind}{r}
  54.     sleep 500
  55.     return
  56.     }
  57.  
  58. snapTEST()
  59.     {
  60.     snapSteps((lookDistance)*zoomLevel, 512)
  61.     snapSteps((-lookDistance)*zoomLevel, 512)
  62.     return
  63.     }
  64.  
  65. ;;;;;;;;;;;;
  66. ; Bindings ;
  67. ;;;;;;;;;;;;
  68. ~*b::
  69.     testFire()
  70.     return
  71.  
  72. F5:: ; Refresh
  73.     MsgBox Script refreshed
  74.     reload
  75.     return
  76.  
  77. F4:: ; Run Test
  78.     Q := DllCall("QueryPerformanceFrequency", "int64*", F) ; MacroRecorder bull
  79.     QPC(1)
  80.     snapTEST()
  81.     snapTEST()
  82.     snapTEST()
  83.     snapTEST()
  84.     snapTEST()
  85.     snapTEST()
  86.     reload
  87.     return
  88.  
  89. ;;;;;;;;;;;;;;;;;;;;;;;
  90. ; MacroRecorder stuff ;
  91. ;;;;;;;;;;;;;;;;;;;;;;;
  92. SendMouse_RelativeMove(x, y) { ; send {blind}fast relative mouse moves
  93.     DllCall("mouse_event", "UInt", 0x01, "UInt", x, "UInt", y) ; move
  94.     }
  95.  
  96. QPC_Sleep(S) {
  97.     global Q,F
  98.     DllCall("QueryPerformanceCounter", "int64*", C1)
  99.     while (((C2 - C1) / F) < S)
  100.     DllCall("QueryPerformanceCounter", "int64*", C2)
  101.     return true
  102.     }
  103.  
  104. QPC(R := 0) {
  105.     global Q,F
  106.     static P := 0
  107.     return !DllCall("QueryPerformanceCounter", "int64*", Q) + (R ? (P := Q) / F : (Q - P) / F)
  108.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement