; ; 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. ^F10:: Suspend ;this means you can press F10 to pause/unpause the script allowing you to use keys normally (needs to be first line of hotkey) if GetKeyState("it") Send {i up} if GetKeyState("LCtrl") Send {LCtrl up} return crouchState:=0 ~c::Goto Crouch ~Space:: if crouchState GoSub, Crouch return ~w & i Up:: if crouchState GoSub, Crouch Send {i down} while GetKeyState("w","P") and not GetKeyState("i", "P") { if crouchState break sleep 50 ; prevents high cpu usage } if GetKeyState("i") Send {i up} ;SoundBeep sleep 150 return Crouch: if crouchState Send {LCtrl up} else Send {LCtrl down} crouchState := !crouchState return ~w & i::Goto iUp iUp: Send {i down} ~i::Goto iUp2 iUp2: Send {i down}