Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; F4 runs the script. ;
- ; F5 refreshes the script after modifications. ;
- ; Assumes 24000 dpi, 10.0 in-game sens, 0.1 V/H scale ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;
- ; Init ;
- ;;;;;;;;
- SendMode, Input
- #InstallKeybdHook
- #InstallMouseHook
- SetWorkingDir %A_ScriptDir%
- SetTitleMatchMode 1
- SetControlDelay 1
- SetWinDelay 0
- SetKeyDelay -1
- SetMouseDelay -1
- SetBatchLines -1
- #MenuMaskKey vk07
- ;;;;;;;;;;;;;;;;;;;
- ; Test case setup ;
- ;;;;;;;;;;;;;;;;;;;
- ; Variables ;
- ;;;;;;;;;;;;;
- global lookDistance := 1000 ;Distance for a full 360
- global zoomLevel := 1 ;Zoom level to scale sens
- ; Functions ;
- ;;;;;;;;;;;;;
- snapSteps(distance, steps) { ; Snaps in steps
- While (A_Index <= steps) {
- SendMouse_RelativeMove((distance/steps), 0)
- QPC_Sleep(1/steps)
- }
- testFire()
- QPC_Sleep(1.5)
- return
- }
- testFire()
- {
- send {blind}{Numpad5}
- sleep 500
- send {blind}{Numpad5}
- sleep 500
- send {blind}{k}
- sleep 500
- send {blind}{Numpad5}
- sleep 500
- send {blind}{r}
- sleep 500
- return
- }
- snapTEST()
- {
- snapSteps((lookDistance)*zoomLevel, 512)
- snapSteps((-lookDistance)*zoomLevel, 512)
- return
- }
- ;;;;;;;;;;;;
- ; Bindings ;
- ;;;;;;;;;;;;
- ~*b::
- testFire()
- return
- F5:: ; Refresh
- MsgBox Script refreshed
- reload
- return
- F4:: ; Run Test
- Q := DllCall("QueryPerformanceFrequency", "int64*", F) ; MacroRecorder bull
- QPC(1)
- snapTEST()
- snapTEST()
- snapTEST()
- snapTEST()
- snapTEST()
- snapTEST()
- reload
- return
- ;;;;;;;;;;;;;;;;;;;;;;;
- ; MacroRecorder stuff ;
- ;;;;;;;;;;;;;;;;;;;;;;;
- SendMouse_RelativeMove(x, y) { ; send {blind}fast relative mouse moves
- DllCall("mouse_event", "UInt", 0x01, "UInt", x, "UInt", y) ; move
- }
- QPC_Sleep(S) {
- global Q,F
- DllCall("QueryPerformanceCounter", "int64*", C1)
- while (((C2 - C1) / F) < S)
- DllCall("QueryPerformanceCounter", "int64*", C2)
- return true
- }
- QPC(R := 0) {
- global Q,F
- static P := 0
- return !DllCall("QueryPerformanceCounter", "int64*", Q) + (R ? (P := Q) / F : (Q - P) / F)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement