; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; ; ; Only run this script when bf2.exe is running in the foreground ; #SingleInstance force #InstallKeybdHook SetTimer, KeepRunning return KeepRunning: ; Get the process name of the active window (i.e. Notepad.exe) WinGet, szProcessName, ProcessName, A if szProcessName = bf2.exe { Suspend, off } else { Suspend, on } return ; ; Disable the Window's keys so they don't switch to desktop while in-game ; $LWin:: ; Left Windows Button $RWin:: ; Right Windows Button ; Do nothing return $^CapsLock:: ExitApp return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Pressing Ctrl+V while BF2 is active ; $^v:: SetKeyDelay, 30,30 Sleep 200 Send, {Space}%clipboard% SetKeyDelay, 0 return SayToAll(a_szMessage) { SetKeyDelay, 30,30 Send, {j Down} Sleep 100 Send, {j Up} Send, %a_szMessage%{Enter} SetKeyDelay, 0 } SayToSquad(a_szMessage) { SetKeyDelay, 30,30 Send, {l Down} Sleep 100 Send, {l Up} Send, %a_szMessage%{Enter} SetKeyDelay, 0 } SayToTeam(a_szMessage) { SetKeyDelay, 30,30 Send, {k Down} Sleep 100 Send, {k Up} Send, %a_szMessage%{Enter} SetKeyDelay, 0 } $Numpad1:: $NumpadEnd:: SayToTeam("I'm using the APC because no one else is...if you want it get in and ask me to Bail out") return $Numpad2:: $NumpadDown:: SayToTeam("Enemy near the Hotel!!!") return $Numpad3:: $NumpadPgDn:: SayToTeam("Armor available at Gas Station") return $Numpad4:: $NumpadLeft:: SayToAll("GLICHERS IN HOTEL!!!!") return $Numpad5:: $NumpadClear:: SayToSquad("Enemy nearby, cover me") return $Numpad6:: $NumpadRight:: SayToSquad("Go ahead, I'll cover your back") return
Very simple script that types a message to your team (presses 'k'). I played around with the KeyDelay. If you type too fast BF2 will only register every 2nd or 3rd character in the message.
Make sure to use {Enter} at the end of the message.
Notice also that I use both $Numpad1 and $NumpadEnd keymaps. This way I don't have to check whether I have my NumLock key on/off.
Here are the other keys if you wanted to add more messages:
$Numpad0::
$NumpadIns::
$Numpad1::
$NumpadEnd::
$Numpad2::
$NumpadDown::
$Numpad3::
$NumpadPgDn::
$Numpad4::
$NumpadLeft::
$Numpad5::
$NumpadClear:: ; same physical key as Numpad5 on most keyboards
$Numpad6::
$NumpadRight::
$Numpad7::
$NumpadHome::
$Numpad8::
$NumpadUp::
$Numpad9::
$NumpadPgUp::
$NumpadDot:: ; the decimal point (period) key
$NumpadDel::