Advanced config for TeamFortress

Automatic report of flag take and drop (simple version)

// warning! some maps are broken and f_took, f_drop triggres won't be called
// For example: oppose1
register v_flag_place
// automatically called when you taking flag
alias f_took "say_team @G I've got a flag!"
// automatically called when you killed with flag
alias f_drop "say_team @RENEMY FLAG: %d; set_ex v_flag_place %d;"
// This alias can be used later
alias enemy_flag "say_team @RENEMY FLAG: @v_flag_place"

Onscreen indicators for grenades

// Grenade counters
register n_gren1
register n_gren2

// inv output parsing
re_trigger numgren1 "^Gren.Type 1 :  (.+)\((.)\)"
re_trigger_options numgren1 final remove mask 4
alias numgren1 "n_gren1 @2"

re_trigger numgren2 "^Gren.Type 2 :  (.+)\((.)\)"
re_trigger_options numgren2 final remove mask 4
alias numgren2 "n_gren2 @2"

// removes spam from console
re_trigger inv_spam "(^You\Dre in team|\w+ armor|^Skin \:|^Colors \:|^Scanner|^$)" 
re_trigger_options inv_spam final remove mask 4 noaction

// grenade priming
// automatically decreases proper counter and plays sound
re_trigger gren1primed "^(G|Flash g)renade primed"
re_trigger_options gren1primed final mask 4
alias gren1primed "n_gren1 @-1;play count.wav"

re_trigger gren2primed "^(Concussion|Mirv|Nail|EMP|Napalm|Gas) grenade primed"
re_trigger_options gren2primed final mask 4
alias gren2primed "n_gren2 @-1;play count.wav"

// automatically called when you picking up anything
// updates grenade counters
alias f_bonusflash inv

// automatically called at respawn
// initiallizes grenade counters
alias f_respawn inv

// grenade counters  are displayed near the top left corner of screen
hud_add g1 str "g1:@n_gren1"
hud_position g1 1 0 4

hud_add g2 str "g2:@n_gren2"
hud_position g2 1 0 5

Score indicator

// Colorful score indicator by RnD[.]
register bluescore redscore
set bluescore " 0"
set redscore " 0"

// red and blue indicators in lower rigt corner of screen
hud_add bluescore str " @bluescore"
hud_add redscore str " @redscore"
hud_position bluescore 3 0 4
hud_position redscore 3 0 3
hud_bg bluescore 218
hud_bg redscore 72

// score change parsing
re_trigger newscore_t "^DarkBlue:.*?( 0|(?<= )[^0]\d+) Red:.*?( 0|(?<= )[^0]\d+)"
re_trigger_options newscore_t final mask 4
alias newscore_t "bluescore '@1'; redscore '@2'"

// showscores parsing
re_trigger bscore_t "^Team 1 \(DarkBlue\) :.*( 0|(?<= )[^0]\d+)"
re_trigger rscore_t "^Team 2 \(Red\) :.*( 0|(?<= )[^0]\d+)"
re_trigger_options bscore_t final mask 4
re_trigger_options rscore_t final mask 4
alias bscore_t "bluescore '@1'"
alias rscore_t "redscore '@1'"

// initialization
alias f_mapstart "impulse 145" 

Simple Ammo indicators

// alternative status bar for ammo by RnD[.]
// useful for viewsize > 100
hud_add h_shells str "s:%s"
hud_position h_shells 1 0 13
hud_add h_nails str "n:%n"
hud_position h_nails 1 0 14
hud_add h_rockets str "r:%r"
hud_position h_rockets 1 0 15
hud_add h_cells str "c:%c"
hud_position h_cells 1 0 16

Class-specific configs

Demoman

// DEMOMAN triggers
// requires cl_substsinglequote set to 1
register v_detdeath v_det_place dp_time
v_detdeath "say_team @YDetpack wasn''t set!; alias f_death"

// called when you are trying to set detpack
re_trigger dptry "^Setting detpack for (.+) seconds"
re_trigger_options dptry final remove mask 4
alias dptry "say_team @BDetpack for @1 seconds [%l];dp_time @1;alias f_death '@v_detdeath'"

// called when you succesfully set detpack
re_trigger dpset "^Detpack set!"
re_trigger_options dpset final remove mask 4
alias dpset "say_team @GDetpack-@dp_time set! [%l];set_ex v_det_place %l; alias f_death"

// called when you decided not to set detpack
re_trigger dpnotset "^Detpack retrieved."
re_trigger_options dpnotset final remove mask 4
alias dpnotset "say_team @YDetpack wasn''t set!; alias f_death"

// Warns your teammates about the detpack explosion
re_trigger dpwarning "^3\.\.\."
re_trigger_options dpwarning final mask 4
alias dpwarning "say_team @YRun Away! Detpack is going to BLOW! [@v_det_place]"

Engineer

// ENGINEER triggers
re_trigger disp_ready "^You finish building the dispenser"
re_trigger_options disp_ready final remove mask 4
alias disp_ready "say_team Dispenser built [%l]"

re_trigger sgl1 "^You finish building the sentry gun"
re_trigger_options sgl1 final remove mask 4
alias sgl1 "say_team SG built [%l]"

re_trigger sgl2 "^You upgrade the Sentry Gun to level (.+)"
re_trigger_options sgl2 final remove mask 4
alias sgl2 "say_team SG is level @1 [%l]#def"

Spy

// SPY triggers
register spy_class 
alias spy_report "say_team @BI''m spy skin: %b @spy_class [%l]"

re_trigger change_skin "^Skin set to (.+)" 
re_trigger_options change_skin final remove mask 4
alias change_skin "spy_class '@1'; say_team @BI''m spy, skin:@spy_class" 

re_trigger change_color "^Colors set to"
re_trigger_options change_color final remove mask 4
alias change_color "say_team @YI''m spy, skin:@spy_class. Color changed!"