; ; AutoHotkey Version: 1.x ; Language: English ; Author: Jonathon Rogers ; ; Script Function: ; "Modern Warfare 2"-like toggle crouch and toggle sprint for "Battlefield: Bad Company 2" ; #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ;#InstallKeybdHook ;uncomment to install the keyboard hook driver (if things aren't working right) #MaxThreadsPerHotkey 1 SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ^F1:: Suspend ;this means you can press F1 to pause/unpause the script allowing you to use keys normally (needs to be first line of hotkey) if GetKeyState("LShift") Send {LShift up} if GetKeyState("LCtrl") Send {LCtrl up} return crouchState:=0 ~c::Goto Crouch ~Space:: if crouchState GoSub, Crouch return ~w & LShift Up:: if crouchState GoSub, Crouch Send {LShift down} while GetKeyState("w","P") and not GetKeyState("LShift", "P") { if crouchState break sleep 100 ; prevents high cpu usage } if GetKeyState("LShift") Send {LShift up} ;SoundBeep sleep 150 return Crouch: if crouchState Send {LCtrl up} else Send {LCtrl down} crouchState := !crouchState return