Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (checkalias atfrags) [] [ // Make stats collecting aliases if they do not already exist.
- curflags = 0
- atflags = 0
- curfrags = 0
- atfrags = 0
- curdeaths = 0
- atdeaths = 0
- curscore = 0
- atscore = 0
- curratio = 0
- atratio = 0
- cursniper = 0
- cursniperdmg = 0
- cursmg = 0
- cursmgdmg = 0
- curshot = 0
- curshotdmg = 0
- curar = 0
- curardmg = 0
- curcarb = 0
- curcarbdmg = 0
- curusp = 0
- curuspdmg = 0
- curaki = 0
- curakidmg = 0
- curknife = 0
- curknifedmg = 0
- clast = 0
- rvsfst = 0
- games_played = 0
- tkst = 0
- htkst = 0
- stkst = 0
- gtkst = 0
- ktkst = 0
- ftkst = 0
- hsst = 0
- knst = 0
- spst = 0
- gbst = 0
- cfst = 0
- dfst = 0
- lfst = 0
- kfst = 0
- sfst = 0
- suicides = 0
- ]
- addcheck_si [+= games_played 1]
- calc = [ // Function used for gathering and calculating stats
- curflags = (at (pstat_score (findcn $curname)) 0)
- curfrags = (at (pstat_score (findcn $curname)) 1)
- curdeaths = (at (pstat_score (findcn $curname)) 2)
- curscore = (at (pstat_score (findcn $curname)) 3)
- cursniper = (at (pstat_weap (findcn $curname)) 10)
- cursniperdmg = (at (pstat_weap (findcn $curname)) 11)
- cursmg = (at (pstat_weap (findcn $curname)) 8)
- cursmgdmg = (at (pstat_weap (findcn $curname)) 9)
- curar = (at (pstat_weap (findcn $curname)) 12)
- curardmg = (at (pstat_weap (findcn $curname)) 13)
- curshot = (at (pstat_weap (findcn $curname)) 6)
- curshotdmg = (at (pstat_weap (findcn $curname)) 7)
- curcarb = (at (pstat_weap (findcn $curname)) 4)
- curcarbdmg = (at (pstat_weap (findcn $curname)) 5)
- curusp = (at (pstat_weap (findcn $curname)) 2)
- curuspdmg = (at (pstat_weap (findcn $curname)) 3)
- curaki = (at (pstat_weap (findcn $curname)) 18)
- curakidmg = (at (pstat_weap (findcn $curname)) 19)
- curnade = (at (pstat_weap (findcn $curname)) 16)
- curnadedmg = (at (pstat_weap (findcn $curname)) 17)
- curknife = (at (pstat_weap (findcn $curname)) 0)
- curknifedmg = (at (pstat_weap (findcn $curname)) 1)
- curratio = (divf $curfrags $curdeaths)
- // if (&& (<= $minutesremaining 0) (= $strst 0)) [ // Add current score to all-time totals during intermission.
- += atfrags $curfrags // TODO: Make it possible to add to these for on-the-fly all-time stats viewing.
- += atdeaths $curdeaths
- += atscore $curscore
- += atflags $curflags
- atscoreavg = (divf $curscore $games_played)
- atratio = (divf $atfrags $atdeaths)
- if (= (curmodeattr team) 1) [ // Check if user is in a team mode.
- if (= (curteam) 1) [ // If playing for RVSF, +1 to it's stat.
- += rvsfst 1
- // Did I tell you, team info is kept in pstat_score? ; Seen that, wasn't sure how to use it correctly since it was returning 0 even while in DM. :-s
- ] [
- += clast 1 // Else they are playing for CLA, +1 to it's stat.
- ]] []
- strst = 1 // In case if this function is called more than once during the intermission, mark this as 1 so the above if statement fails.
- // ] []
- if (= $gamemode 0) [
- modest = "TDM"
- ] [
- if (= $gamemode 2) [
- modest = "DM"
- ] [
- if (= $gamemode 4) [
- modest = "TSURV"
- ] [
- if (= $gamemode 3) [
- modest = "SURV"
- ] [
- if (= $gamemode 5) [
- modest = "CTF"
- ] [
- if (= $gamemode 13) [
- modest = "HTF"
- ] [
- if (= $gamemode 15) [
- modest = "KTF"
- ] [
- if (= $gamemode 14) [
- modest = "TKTF"
- ] [
- if (= $gamemode 6) [
- modest = "PF"
- ] [
- if (= $gamemode 9) [
- modest = "LSS"
- ] [
- if (= $gamemode 10) [
- modest = "OSOK"
- ] [
- if (= $gamemode 11) [
- modest = "TOSOK"
- ] [
- if (= $gamemode 7) [
- modest = "BTDM"
- ] [
- if (= $gamemode 8) [
- modest = "BDM"
- ] [
- if (= $gamemode 12) [
- modest = "BOSOK"
- ] [
- if (= $gamemode 1) [
- modest = "COOP"
- ] []]]]]]]]]]]]]]]]
- ]
- clrst = [ // Function used to clear temporary script flow aliases on every map start.
- strst = 0
- hsst = 0
- knst = 0
- spst = 0
- gbst = 0
- cfst = 0
- dfst = 0
- lfst = 0
- kfst = 0
- sfst = 0
- tkst = 0
- htkst = 0
- ktkst = 0
- ftkst = 0
- gtkst = 0
- stkst = 0
- cvflag = 0
- dfflag = 0
- suicides = 0
- combo = 0
- mcombo = 0
- ]
- stats = [
- calc // Gather and calculate the stats.
- ocsize = $consize
- if (strcmp $arg1 "all") [ // If user entered "all" as the first argument display the all-time stats instead.
- echo ""
- echo All-Time Frags: $atfrags
- echo All-Time Deaths: $atdeaths
- echo All-Time Score: $atscore
- if (< $atdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
- echo All-Time Ratio: (concatword $atfrags .0)
- ] [
- echo All-Time Ratio: $atratio
- ]
- echo CLA: $clast
- echo RVSF: $rvsfst
- ] [ // Else show user the current round stats.
- consize 24
- echo ""
- echo Flags: $curflags
- echo Frags: $curfrags
- echo Deaths: $curdeaths
- if (= $connected 1) [ // Score is only calculated in multiplayer.
- echo Score: $curscore
- ] [
- echo Score: N/A
- ]
- if (< $curdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
- echo Ratio: (concatword $curfrags .0)
- ] [
- echo Ratio: $curratio
- ]
- echo FTK's: $ftkst
- echo HTK's: $htkst
- echo STK's: $htkst
- echo KTK's: $ktkst
- echo GTK's: $gtkst
- echo Total TK's: $tkst
- echo ""
- if (= $connected 1) [ // Weapon damage is only shown in multiplayer, for some reason. :(
- echo Sniper: (concatword $cursniper / $cursniperdmg)
- echo SMG: (concatword $cursmg / $cursmgdmg)
- echo AR: (concatword $curar / $curardmg)
- echo Shotgun: (concatword $curshot / $curshotdmg)
- echo Carbine: (concatword $curcarb / $curcarbdmg)
- echo Pistol: (concatword $curusp / $curuspdmg)
- echo Akimbo: (concatword $curaki / $curakidmg)
- echo Grenade: (concatword $curnade / $curnadedmg)
- echo Knife: (concatword $curknife / $curknifedmg)
- echo ""
- echo Weapon stats are currently shots/damage.
- ] [
- echo Sniper: $cursniper
- echo SMG: $cursmg
- echo AR: $curar
- echo Shotgun: $curshot
- echo Carbine: $curcarb
- echo Pistol: $curusp
- echo Akimbo: $curaki
- echo Grenade: $curnade
- echo Knife: $curknife
- echo ""
- echo Weapon stats for SP are currently # of shots fired.
- sleep 10000 [consize $ocsize]
- ]]]
- get_stats = [ // Function used for gathering stats that pstat_score cannot access.
- if (= (strstr $conline "3you fragged teammate") 1) [
- += tkst 1; += ftkst 1; conline [ ]
- ] [
- if (= (strstr $conline "3you headshotted teammate") 1) [
- += tkst 1; += htkst 1; conline [ ]
- ] [
- if (= (strstr $conline "3you splattered teammate") 1) [
- += tkst 1; += stkst 1; conline [ ]
- ] [
- if (= (strstr $conline "3you knifed teammate") 1) [
- += tkst 1; += ktkst 1; conline [ ]
- ] [
- if (= (strstr $conline "3you gibbed teammate") 1) [
- += tkst 1; += gtkst 1; conline [ ]
- ] [
- if (&& (= (strstr $conline "you headshotted") 1) (= (strstr $conline "3teammate") 0)) [
- += hsst 1; conline [ ]
- ] [
- if (&& (= (strstr $conline "you knifed") 1) (= (strstr $conline "3teammate") 0)) [
- += knst 1; conline [ ]
- ] [
- if (&& (= (strstr $conline "you splattered") 1) (= (strstr $conline "3teammate") 0)) [
- += spst 1; conline [ ]
- ] [
- if (&& (= (strstr $conline "you gibbed") 1) (= (strstr $conline "3teammate") 0)) [
- += gbst 1; conline [ ]
- ] [
- if (= (strcmp $conline "2you got the enemy flag") 1) [
- += sfst 1; conline [ ]
- ] [
- if (= (strcmp $conline "2you got the flag") 1) [
- += sfst 1; conline [ ]
- ] [
- if (= (strcmp $conline "2you dropped the flag") 1) [
- += dfst 1; conline [ ]
- ] [
- if (= (strcmp $conline "2you lost the flag") 1) [
- += lfst 1; conline [ ]
- ] [
- if (= (strstr $conline "2you have kept the flag for") 1) [ // TKTF/KTF Flags
- += kfst 1; conline [ ]
- ][
- if (&& (= $gamemode 5) (= (strcmp $conline "2you scored") 1)) [ // CTF Flags
- += cfst 1; conline [ ]
- ] [
- if (&& (= $gamemode 13) (= (strcmp $conline "2you scored") 1)) [ // HTF Flags
- += hfst 1; conline [ ]
- ] [
- if (= (strcmp $conline "you covered the flag") 1) [
- += cvflag 1; conline [ ]
- ] [
- if (= (strcmp $conline "you defended the flag") 1) [
- += dfflag 1; conline [ ]
- ] [
- if (= (strcmp $conline "YOU COVERED THE FLAG") 1) [ // Turns out strcmp is case-sensitive. Damn you /hudextras 3... :P
- += cvflag 1; conline [ ]
- ] [
- if (= (strcmp $conline "YOU DEFENDED THE FLAG") 1) [
- += dfflag 1; conline [ ]
- ] [
- if (= (strcmp $conline "2you suicided!") 1) [
- += suicides 1; conline [ ]
- ] [
- if (= (strcmp $conline "combo") 1) [
- += combo 1; conline [ ]
- ] [
- if (= (strcmp $conline "multi combo x2") 1) [
- +mcombo 1; conline [ ]
- ] []]]]]]]]]]]]]]]]]]]]]]]
- sleep 1 [get_stats]
- ]
- if (strstr $mapstartalways clrst) [] [ // Automate stuff :)
- add2alias mapstartalways [clrst; sleep 3 [get_stats]]
- add2alias start_intermission [stats]
- ]
- newmenu "Current Round Statistics"
- menuinit [(calc)]
- menuitemvar [concat (c 4)Here are your stats for $modest (concatword (curmap 1) :)]
- menuitem "" -1
- menuitemvar [concat (c 0) " ~Flags~"]
- menuitemtextinput "2Scored: " "result $cfst" // CTF Flags
- menuitemtextinput "2Covered: " "result $cvflag"
- menuitemtextinput "2Defended: " "result $dfflag"
- menuitemtextinput "2Dropped: " "result $dfst"
- menuitemtextinput "2Hunted: " "result $hfst" // HTF Flags
- menuitemtextinput "2Kept: " "result $kfst" // TKTF/KTF Flags
- menuitemtextinput "3Lost: " "result $lfst"
- menuitemtextinput "2Stolen: " "result $sfst" // # of times carrying flag.
- menuitem "" -1
- menuitemvar [concat (c 3) " ~Kills~" ]
- menuitemtextinput "2Frags: " "result $curfrags"
- menuitemtextinput "3Deaths: " "result $curdeaths"
- menuitemtextinput "3Suicides: " "result $suicides"
- menuitemtextinput "2Score: " "result $curscore"
- menuitemtextinput "2Combos: " "result $combo"
- menuitemtextinput "2Multi-Combos: " "result $mcombo"
- menuitemtextinput "2Ratio: " "result $curratio"
- menuitemtextinput "2Gibs: " "result $gbst"
- menuitemtextinput "2Headshots: " "result $hsst"
- menuitemtextinput "2Knife Gibs: " "result $knst"
- menuitemtextinput "2Splatters: " "result $spst"
- menuitemtextinput "3FTK's: " "result $ftkst"
- menuitemtextinput "3HTK's: " "result $htkst"
- menuitemtextinput "3STK's: " "result $stkst"
- menuitemtextinput "3KTK's: " "result $ktkst"
- menuitemtextinput "3GTK's: " "result $gtkst"
- menuitemtextinput "7Total TK's: " "result $tkst"
- menuitem "" -1
- menuitemvar [concat (c 1) " ~Weapons~" ]
- menuitemtextinput "2Sniper: " [(concatword $cursniper / $cursniperdmg)]
- menuitemtextinput "2SMG: " [(concatword $cursmg / $cursmgdmg)]
- menuitemtextinput "2AR: " [(concatword $curar / $curardmg)]
- menuitemtextinput "2Shotgun: " [(concatword $curshot / $curshotdmg)]
- menuitemtextinput "2Carbine: " [(concatword $curcarb / $curcarbdmg)]
- menuitemtextinput "2Pistol: " [(concatword $curusp / $curuspdmg)]
- menuitemtextinput "2Akimbo: " [(concatword $curaki / $curakidmg)]
- menuitemtextinput "2Grenade: " [(concatword $curnade / $curnadedmg)]
- menuitemtextinput "2Knife: " [(concatword $curknife / $curknifedmg)]
- menuitem "" -1
- menuitemvar [concat (c 4)Weapon stats are currently shots/damage.]
- showcurstatsbind = [ // Pre-built alias that users can bind to a key for easy menu viewing.
- calc
- showmenu "Current Round Statistics"
- onrelease [closemenu "Current Round Statistics"]
- ]
- bind BACKQUOTE [showcurstatsbind]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement