Page 1 of 1

AK's stats script modified

Posted: Fri May 19, 2006 3:30 pm
by Cnnlngs
hi. since it seems AK is gone i made some small adjustments to his script:

- now the script substracts 1 frag from the total kills (as in real aq2) when you fall (including when you fall in mesto) and when you kill a teammate
- added the missing kickfrag trigger

the code below is the default AK script (as seen on http://koti.mbnet.fi/akmods/aq2/statscript/) with the changes, and it's ready for copy, paste & play.

EDIT: fixed a huge bug, now it will work ok

Code: Select all

// AK's Statistics script v0.3 for AprQ2 >1.19b

//// User changeable variables

set counter_show_amount "1" // 1 = Show number of awards, grenade kills and knife kills, 0 = don't show
set counter_show_stat "1" // Show stats at the end of the map
set counter_excellentcounter "1" // 1 = "Frags to excellent" counter is on, 0 = off
set counter_fragsleft "8" // How many frags has to be left until a msg is shown
set counter_fragstoexcellent_msg "Frags to get until excellent: $counter_fragstoexcellent"
set counter_fragstoexcellent_msg_tk "It was a teammate so frags until excellent: $counter_fragstoexcellent"
set counter_excellentlost_msg "Aww, you lost your excellent! There were only $counter_fragstoexcellent frags left! :("

alias counter_autoenemyd "say_team " // Automatic enemy down message, fill in your message or alias if you want to use it
set counter_useautoenemyd "0" // 1 = Use automatic enemy down messages, 0 = off
set counter_usespecialautofragmsg "0" // If you want to use special enemy down message for knife and grenade kills then change this to 1
set counter_useautobandagemsg "0" // If you want to use automatic bandage message, change this to 1
set counter_autobandagemsg "I'm bandaging my $counter_lasthit$! Cover me %T!" // Automatic bandage message, fill in your message if you want to use it
set counter_autogrenadekillmsg "" // Automatic grenade kill message, fill in your message if you want to use it
set counter_autoknifekillmsg "" // Automatic knife kill message, fill in your message if you want to use it
set counter_fragsneededforexcellent "12" // Heard that there are servers that need 15 frags for an excellent so change if needed

//// Script start [Don't change anything below unless you know what it does]

// Counter reset
alias counter_damage_reset "set counter_head 0;set counter_kevlarhelmet 0;set counter_chest 0;set counter_kevlarvest 0;set counter_stomach 0;set counter_leg 0"
alias counter_award_reset "set counter_accuracy 0;set counter_impressive 0;set counter_excellent 0"
alias counter_kill_reset "set counter_pistolkills 0;set counter_akimbokills 0;set counter_mp5kills 0;set counter_m4kills 0;set counter_ssgkills 0;set counter_m3kills 0;set counter_hckills 0;set counter_hctwobarrelkills 0;set counter_hconebarrelkills 0;set counter_kickkills 0;set counter_punchkills 0;set counter_dropkills 0;set counter_grenadekills 0;set counter_knifekills 0;set counter_knifekills_throw 0;set counter_knifekills_slash 0;set counter_totalkills 0"
alias counter_misc_reset "set counter_falls 0;set counter_bandages 0;set counter_deaths 0;set counter_fragstoexcellent $counter_fragsneededforexcellent;set counter_lasthit nowhere"
alias counter_reset "counter_damage_reset;counter_award_reset;counter_kill_reset;counter_misc_reset;echo Statistics counter reset"
if $counter_script_loaded != 1 then counter_reset // To prevent resetting of stats if executed again

// Variables used by script, don't change yourself
set counter_special "0"
set counter_script_version "0.3"
set counter_script_loaded "1" // Used to indicate that script is loaded
set counter_roundover "0" // Don't change yourself, used to indicate if round is over or not
set counter_alive "1" // Don't change yourself, used to indicate that player is alive or not

// Award triggers
trigger "inc counter_accuracy;if $counter_show_amount == 1 then echo Accuracy #$counter_accuracy" "ACCURACY $name$*"
trigger "inc counter_impressive;if $counter_show_amount == 1 then echo Impressive #$counter_impressive" "IMPRESSIVE $name$*"
trigger "inc counter_excellent;if $counter_show_amount == 1 then echo Excellent #$counter_excellent;set counter_fragstoexcellent $counter_fragsneededforexcellent" "EXCELLENT $name$*"

// Hits, falls and bandage triggers
trigger "if $counter_roundover == 0 then inc counter_head;set counter_lasthit head" "Head damage"
trigger "if $counter_roundover == 0 then inc counter_kevlarhelmet;set counter_lasthit head" "Kevlar Helmet absorbed*"
trigger "if $counter_roundover == 0 then inc counter_chest;set counter_lasthit chest" "Chest damage"
trigger "if $counter_roundover == 0 then inc counter_kevlarvest;set counter_lasthit chest" "Kevlar Vest absorbed*"
trigger "if $counter_roundover == 0 then inc counter_stomach;set counter_lasthit stomach" "Stomach damage"
trigger "if $counter_roundover == 0 then inc counter_leg;set counter_lasthit leg" "Leg damage"
trigger "if $counter_roundover == 0 then inc counter_totalkills -1;if $counter_roundover == 0 then inc counter_falls" "$name plummets to * death"
trigger "if $counter_roundover == 0 then inc counter_totalkills -1;if $counter_roundover == 0 then inc counter_falls" "$name was in the wrong place"
trigger "if $counter_roundover == 0 then inc counter_bandages;if $counter_useautobandagemsg == 1 then say_team $counter_autobandagemsg" "*started bandaging"

// Round and map triggers
trigger "counter_roundover 0;set counter_alive 1" "LIGHTS..."
trigger "counter_roundover 1" "The round is over*"
trigger "if $counter_show_stat == 1 then mapstats" "Next map in rotation is*"
trigger counter_reset #cl_enterlevel

//// Frag triggers

// Pistol
trigger counter_pistolfrag "*$name$'s Mark 23 pistol"
trigger counter_pistolfrag "*$name$'s .45 caliber pistol round"

// Akimbo pistols
trigger counter_akimbofrag "*$name$'s akimbo Mark 23 pistols"
trigger counter_akimbofrag "*was John Woo'd by $name$*"

// MP5
trigger "counter_frag;if $counter_roundover == 0 then inc counter_mp5kills" "* $name$'s *MP5*"

// M4
trigger "counter_frag;if $counter_roundover == 0 then inc counter_m4kills" "*$name$'s M4*"

// SSG
trigger counter_sniperfrag "*sniper bullet * $name$*"
trigger counter_sniperfrag "*was picked off by $name$*"
trigger counter_sniperfrag "*was sniped in the stomach by $name$*"
trigger counter_sniperfrag "*was shot in the legs by $name$*"

// M3
trigger "counter_frag;if $counter_roundover == 0 then inc counter_m3kills" "*$name$'s M3*"

// HC
trigger "if $counter_roundover == 0 then inc counter_hctwobarrelkills;counter_hcfrag" "*$name$'s sawed*off*"
trigger "if $counter_roundover == 0 then inc counter_hconebarrelkills;counter_hcfrag" "*$name$'s single barreled handcannon*"

// Knife
trigger counter_knifefrag_throw "*$name$'s flying knife*"
trigger counter_knifefrag_slash "*throat slit by $name"
trigger counter_knifefrag_slash "*compliments of $name"
trigger counter_knifefrag_slash "*gutted by $name"
trigger counter_knifefrag_slash "*repeatedly in the legs by $name"

// Grenade
trigger counter_grenadefrag "*see $name$'s handgrenade"

// Kick
trigger counter_kickfrag "*got * ass kicked by $name"
trigger counter_kickfrag "*$name$, with a quickness"
trigger counter_kickfrag "*remove $name$'s boot from * ass"
trigger "counter_kickfrag" "*Bruce Lee put on it by $name$"

// Punch
trigger counter_punchfrag "*was knocked out by $name"
trigger counter_punchfrag "*got a free facelift by $name"
trigger counter_punchfrag "*$name$'s iron fist"

// Drops
trigger "counter_frag;if $counter_roundover == 0 then inc counter_dropkills" "*was taught how to fly by $name"

// Teamkill
trigger counter_teamkill "You killed your TEAMMATE!"

//// Death triggers
trigger counter_death "$name had*"
trigger counter_death "$name was*"
trigger counter_death "$name got*"
trigger counter_death "$name saw*"
trigger counter_death "$name won't*"
trigger counter_death "$name caught*"
trigger counter_death "$name$'s brains*"
trigger counter_death "$name$'s ribs*"
trigger counter_death "$name sees*"
trigger counter_death "$name needs*"
trigger counter_death "$name feels*"
trigger counter_death "$name accepts*"
trigger counter_death "$name didn*"
trigger counter_death "$name couldn*"
trigger counter_death "$name has a hole*"
trigger counter_death "$name has an upset*"
trigger counter_death "$name loses*"
trigger counter_death "$name underestimated*"
trigger counter_death "$name ate*"
trigger counter_death "$name is *"
trigger counter_death "$name plummets*"
trigger counter_death "$name killed*"
trigger counter_death "$name melted"
trigger counter_death "$name sank like a rock"

//// Aliases

// Frag related aliases
alias counter_pistolfrag "if $counter_roundover == 0 then inc counter_pistolkills;counter_frag"
alias counter_akimbofrag "if $counter_roundover == 0 then inc counter_akimbokills;counter_frag"
alias counter_sniperfrag "if $counter_roundover == 0 then inc counter_ssgkills;counter_frag"
alias counter_hcfrag "if $counter_roundover == 0 then inc counter_hckills;counter_frag"
alias counter_kickfrag "if $counter_roundover == 0 then inc counter_kickkills;counter_frag"
alias counter_punchfrag "if $counter_roundover == 0 then inc counter_punchkills;counter_frag"
alias counter_grenadefrag "if $counter_roundover == 0 then inc counter_grenadekills;if $counter_roundover == 0 then if $counter_show_amount == 1 then echo Grenade kill #$counter_grenadekills;if $counter_roundover == 0 then if $counter_alive == 1 then if $counter_usespecialautofragmsg == 1 then say_team $counter_autogrenadekillmsg;if $counter_usespecialautofragmsg == 1 then set counter_special 1;counter_frag"
alias counter_knifefrag_throw "if $counter_roundover == 0 then inc counter_knifekills_throw;counter_knifefrag"
alias counter_knifefrag_slash "if $counter_roundover == 0 then inc counter_knifekills_slash;counter_knifefrag"
alias counter_knifefrag "if $counter_roundover == 0 then inc counter_knifekills;if $counter_roundover == 0 then if $counter_show_amount == 1 then echo Knife kill #$counter_knifekills;if $counter_roundover == 0 then if $counter_alive == 1 then if $counter_usespecialautofragmsg == 1 then say_team $counter_autoknifekillmsg;if $counter_usespecialautofragmsg == 1 then set counter_special 1;counter_frag"
alias counter_death "if $counter_roundover == 0 then counter_fragstoexcellent_reset;if $counter_roundover == 0 then inc counter_deaths;set counter_alive 0"
alias counter_frag "if $counter_roundover == 0 then inc counter_totalkills;if $counter_roundover == 0 then if $counter_alive == 1 then if $counter_useautoenemyd == 1 then if $counter_special == 0 then counter_autoenemyd;if $counter_roundover == 0 then if $counter_alive == 1 then inc counter_fragstoexcellent -1;if $counter_excellentcounter == 1 then if $counter_alive == 1 then if $counter_fragstoexcellent <= $counter_fragsleft then if 0 < $counter_fragstoexcellent then echo $counter_fragstoexcellent_msg;set counter_special 0"
alias counter_teamkill "if $counter_roundover == 0 then inc counter_totalkills -1;if $counter_roundover == 0 then if $counter_alive == 1 then inc counter_fragstoexcellent;if $counter_excellentcounter == 1 then if $counter_alive == 1 then if $counter_fragstoexcellent <= $counter_fragsleft then echo $counter_fragstoexcellent_msg_tk"
alias counter_fragstoexcellent_reset "if $counter_fragstoexcellent < 3 then if $counter_excellentcounter == 1 then echo $counter_excellentlost_msg;set counter_fragstoexcellent 12"

// Statistics commands
alias mapstats "counter_emptyline;counter_line01;counter_emptyline;counter_k_line01;counter_emptyline" // Type "mapstats" to show all your statistics
alias miscstats "counter_emptyline;counter_line01;counter_emptyline" // Type "miscstats" to show only your misc personal statistics
alias killstats "counter_emptyline;counter_k_line01;counter_emptyline" // Type "killstats" to show only your kill statistics
alias counter_emptyline "echo  "

// Misc statistics
alias counter_line01 "echo *** Misc statistics in $mapname for $name ***;counter_line02"
alias counter_line02 "echo Awards collected ........ A[$counter_accuracy$] I[$counter_impressive$] E[$counter_excellent$];counter_line03"
alias counter_line03 "echo Head damage count ....... $counter_head;counter_line04"
alias counter_line04 "echo Kevlar Helmet hit count . $counter_kevlarhelmet;counter_line05"
alias counter_line05 "wait;echo Chest damage count ...... $counter_chest;counter_line06"
alias counter_line06 "echo Kevlar Vest hit count ... $counter_kevlarvest;counter_line07"
alias counter_line07 "echo Stomach damage count .... $counter_stomach;counter_line08"
alias counter_line08 "echo Leg damage count ........ $counter_leg;counter_line09"
alias counter_line09 "wait;echo Falls ................... $counter_falls;counter_line10"
alias counter_line10 "echo Deaths .................. $counter_deaths;counter_line11"
alias counter_line11 "echo Bandages used ........... $counter_bandages"

// Kill statistics
alias counter_k_line01 "echo *** Kill statistics in $mapname for $name ***;counter_k_line02"
alias counter_k_line02 "echo Pistol kills ............ $counter_pistolkills;counter_k_line03"
alias counter_k_line03 "echo Akimbo kills ............ $counter_akimbokills;counter_k_line04"
alias counter_k_line04 "echo Knife kills ............. $counter_knifekills [Throw: $counter_knifekills_throw / Slash: $counter_knifekills_slash$];counter_k_line05"
alias counter_k_line05 "echo MP5 kills ............... $counter_mp5kills;counter_k_line06"
alias counter_k_line06 "echo M4 kills ................ $counter_m4kills;counter_k_line07"
alias counter_k_line07 "wait;echo M3 kills ................ $counter_m3kills;counter_k_line08"
alias counter_k_line08 "echo Handcannon kills ........ $counter_hckills [Classic: $counter_hctwobarrelkills / Single: $counter_hconebarrelkills$];counter_k_line09"
alias counter_k_line09 "echo SSG kills ............... $counter_ssgkills;counter_k_line10"
alias counter_k_line10 "echo Grenade kills ........... $counter_grenadekills;counter_k_line11"
alias counter_k_line11 "echo Kick kills .............. $counter_kickkills;counter_k_line12"
alias counter_k_line12 "echo Punch kills ............. $counter_punchkills;counter_k_line13"
alias counter_k_line13 "wait;echo Fly lessons ............. $counter_dropkills;counter_k_line14"
alias counter_k_line14 "echo Total kills ............. $counter_totalkills"

// End of statistics script
echo AK's Statistics script [v$counter_script_version$] loaded!

// EoF


Posted: Fri May 19, 2006 8:25 pm
by Misse
hmm..
I can see some html errors in it right away, some % totally wrong with the $ but other than that. lypsyk

Posted: Sat May 20, 2006 4:32 am
by Janner
Could you tell us what you changed? Because I made some major changes to the "real" AK script, and it is alot easier for me to just edit those lines.

Posted: Sat May 20, 2006 10:06 am
by Cnnlngs
no problem.

// Hits, falls and bandage triggers

trigger "if $counter_roundover == 0 then inc counter_totalkills -1;if $counter_roundover == 0 then inc counter_falls" "$name plummets to * death"
trigger "if $counter_roundover == 0 then inc counter_totalkills -1;if $counter_roundover == 0 then inc counter_falls" "$name was in the wrong place"

//// Frag triggers
// Kick

trigger "counter_kickfrag" "*Bruce Lee put on it by $name$"

//// Aliases
// Frag related aliases

alias counter_teamkill "if $counter_roundover == 0 then inc counter_totalkills -1;if $counter_roundover == 0 then if $counter_alive == 1 then inc counter_fragstoexcellent;if $counter_excellentcounter == 1 then if $counter_alive == 1 then if $counter_fragstoexcellent <= $counter_fragsleft then echo $counter_fragstoexcellent_msg_tk"

that's it. is not that much.
and a question: i don't seem that this is used:

set counter_excellentlost_msg "Aww, you lost your excellent! There were only $counter_fragstoexcellent frags left! :("

how can i make it work? (althogh is not very useful really)

Posted: Sun May 21, 2006 12:38 am
by Paifas

Code: Select all

set counter_excellentlost_msg "Aww, you lost your excellent! There were only $counter_fragstoexcellent frags left! Sad" 
I have ak's script in my cfg, and this works fine. but u will only see it if there was only 2 or 1 frags left..

Posted: Sun May 21, 2006 5:57 am
by Janner
Thank you!

Posted: Sun May 21, 2006 9:23 am
by Cnnlngs
thanks, i didn't noticed that O_o

also i'm adding "inc $counter_totalkills -1" for each time that you kill urself

//// Death triggers
trigger "if $counter_roundover == 0 then inc counter_totalkills -1; counter_death" "$name sank like a rock"
trigger "if $counter_roundover == 0 then inc counter_totalkills -1" "$name was flattened"
trigger "if $counter_roundover == 0 then inc counter_totalkills -1" "$name killed himself"

i didn't added "counter_death" to the last ones, cause it's already added in the triggers above (AK's ones)

but there's one trigger that disturbs me: "$name melted"
when that ever happened? in lava maps?
and if there's another trigger of that kind please name them :)

Posted: Wed May 24, 2006 9:45 am
by AK
Yes, I've missed that one kick msg, thanks. I've made few small additions into the script, but I've forgot to update them on the web site. I might include a suicide counter to the next version in some form too. :)
Cnnlngs wrote:but there's one trigger that disturbs me: "$name melted"
when that ever happened? in lava maps?
In sludge1 for example.

Posted: Wed May 24, 2006 6:34 pm
by Cnnlngs
AK wrote:Yes, I've missed that one kick msg, thanks. I've made few small additions into the script, but I've forgot to update them on the web site. I might include a suicide counter to the next version in some form too. :)
Cnnlngs wrote:but there's one trigger that disturbs me: "$name melted"
when that ever happened? in lava maps?
In sludge1 for example.
great to hear you're back!

yeah Janner helped me out with that :)

P.S.: update the web site :shocker: