Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ;#Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- ;SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- #MaxThreadsPerHotkey 2
- #SingleInstance, force
- Loop ;This loop is to cancel the lean when you SPRINT but not cancel when holding breath or just walking forward
- {
- GetKeyState, ShiftKey, Shift
- GetKeyState, DoubleU, W
- If (ShiftKey = "D" and DoubleU = "D")
- {
- If KeyDownQ {
- KeyDownQ := !KeyDownQ
- SendInput {q up}
- }
- else If KeyDownE {
- KeyDownE := !KeyDownE
- SendInput {e up}
- }
- }
- Sleep, 100 ; To cut down on the massive CPU usage. 1000 = 1 second, adjust to your liking
- }
- ;Delete this line if you want the script to run even when PUBG isnt active (if you want it to work for another game)
- #IfWinActive, PLAYERUNKNOWN'S BATTLEGROUNDS
- global KeyDownQ := false
- global KeyDownE := false
- $q::
- KeyDownQ := !KeyDownQ
- If KeyDownQ {
- SendInput {q down}
- If KeyDownE { ; This is required to cancel the lean in the other directoin
- KeyDownE := !KeyDownE
- SendInput {e up}
- }
- }
- Else
- SendInput {q up}
- Return
- $e::
- KeyDownE := !KeyDownE
- If KeyDownE {
- SendInput {e down}
- If KeyDownQ { ; This is required to cancel the lean in the other directoin
- KeyDownQ := !KeyDownQ
- SendInput {q up}
- }
- }
- Else
- SendInput {e up}
- Return
Add Comment
Please, Sign In to add comment