Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (= (strcmp $altaction_5 " setscope 1; onrelease [ setscope 0 ] ") 1) [ // Add # of times scoped counter to altaction_5...
- altaction_5 = [setscope 1; += scoped 1; onrelease [ setscope 0 ]]
- ] []
- 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 // Weapon shots, damages, etc.
- atsniper = 0
- cursniperdmg = 0
- atsniperdmg = 0
- cursmg = 0
- atsmg = 0
- cursmgdmg = 0
- atsmgdmg = 0
- curshot = 0
- atshot = 0
- curshotdmg = 0
- atshotdmg = 0
- curar = 0
- atar = 0
- curardmg = 0
- atardmg = 0
- curcarb = 0
- atcarb = 0
- curcarbdmg = 0
- atcarbdmg = 0
- curusp = 0
- atusp = 0
- curuspdmg = 0
- atuspdmg = 0
- curnade = 0
- atnade = 0
- curnadedmg = 0
- atnadedmg = 0
- curaki = 0
- ataki = 0
- curakidmg = 0
- atakidmg = 0
- curknife = 0
- atknife = 0
- curknifedmg = 0
- atknifedmg = 0
- clast = 0 // # of times played as CLA.
- rvsfst = 0 // # of times played as RVSF.
- games_played = 0 // Total # of games played.
- tkst = 0 // Teamkills...
- attkst = 0
- htkst = 0
- athtkst = 0
- stkst = 0
- atstkst = 0
- gtkst = 0
- atgtkst = 0
- ktkst = 0
- atktkst = 0
- ftkst = 0
- atftkst = 0
- hsst = 0 // Kills...
- athsst = 0
- knst = 0
- atknst = 0
- spst = 0
- atspst = 0
- gbst = 0
- atgbst = 0
- cfst = 0 // Flags...
- atcfst = 0
- dfst = 0
- atdfst = 0
- hfst = 0
- athfst = 0
- lfst = 0
- atlfst = 0
- kfst = 0
- atkfst = 0
- sfst = 0
- atsfst = 0
- suicides = 0 // Suicides...
- atsuicides = 0
- gmst = 0
- mpst = 0
- tdmst = 0
- dmst = 0
- tsvst = 0
- svst = 0
- ctfst = 0
- htfst = 0
- ktfst = 0
- tktfst = 0
- pfst = 0
- lssst = 0
- osokst = 0
- tosokst = 0
- btdmst = 0
- bdmst = 0
- bosokst = 0
- coopst = 0
- aqueousst = 0
- arabianst = 0
- arcticst = 0
- aridst = 0
- complexst = 0
- depotst = 0
- desertst = 0
- desert2st = 0
- desert3st = 0
- douzest = 0
- // edificest = 0
- elevationst = 0
- gothicst = 0
- iceroadst = 0
- // industrialst = 0
- ingressst = 0
- kellerst = 0
- minesst = 0
- outpostst = 0
- powerst = 0
- rattrapst = 0
- scaffoldst = 0
- shinest = 0
- snowst = 0
- sunsetst = 0
- toxicst = 0
- urbanst = 0
- werkst = 0
- // cvflag = 0 // Cry... :(
- // atcvflag = 0
- // dfflag = 0
- // atdfflag = 0
- // combo = 0
- // atcombo = 0
- // mcombo = 0
- // atmcombo = 0
- acstart = 0 // # of AC launches...
- scoped = 0 // # of times scoped with the sniper rifle.
- atscoped = 0
- rvsfst = 0 // # of times playing for each team stats.
- clast = 0
- offmpst = 0 // # of times playing official or non-official maps stats.
- cstmpst = 0
- cksst = 0
- chksst = 0
- athksst = 0
- ocsize = $consize
- ffast = 0
- botst = 0
- ]
- += acstart 1 // # of times started AC stat, cheap way of doing it I must admit. 8)
- // addcheck_si [+= games_played 1]
- calc = [ // Function used for gathering and calculating stats.
- curflags = (at (pstat_score (findcn $curname)) 0) // Pull as much stuff from pstat as possible.
- 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) // Calculate ratio.
- if (&& (<= $minutesremaining 0) (= $strst 0)) [ // Add current scores to all-time totals during intermission.
- += atfrags $curfrags // Calculate all-time stats. // TODO: Make it possible to add to these for on-the-fly all-time stats viewing.
- += atdeaths $curdeaths
- += atscore $curscore
- += atflags $curflags
- += atratio $curratio
- += atftkst $ftkst // Frag teamkills.
- += athtkst $htkst // Headshot teamkills.
- += atstkst $stkst // Splatter teamkills.
- += atktkst $ktkst // Knife teamkills.
- += atgtkst $gtkst // Grenade teamkills.
- += attkst $tkst // Total teamkills.
- += atsniper $cursniper // # of shots per weapon...
- += atsmg $cursmg
- += atar $curar
- += atshot $curshot
- += atcarb $curcarb
- += atusp $curusp
- += ataki $curaki
- += atnade $curnade
- += atknife $curknife
- += atsniperdmg $cursniperdmg // Per weapon damage stats...
- += atsmgdmg $cursmgdmg
- += atardmg $curardmg
- += atshotdmg $curshotdmg
- += atcarbdmg $curcarbdmg
- += atuspdmg $curuspdmg
- += atakidmg $curakidmg
- += atnadedmg $curnadedmg
- += atknifedmg $curknifedmg
- += atcfst $cfst // CTF flags.
- += atdfst $dfst // Dropped flags.
- += athfst $hfst // Hunted flags.
- += atkfst $kfst // Kept flags.
- += atlfst $lfst // Lost flags.
- += atsfst $sfst // Stolen flags.
- += atgbst $gbst // Grenade gibs.
- += athsst $hsst // Headshots.
- += atknst $knst // Knife gibs.
- += atspst $spst // Splatters...
- += atsuicides $suicides // Suicides...
- += atscoped $scoped // Scopes...
- if (> $chksst $athksst) [ // Highest ever kill streak...
- athksst = $chksst
- ] []
- atscoreavg = (divf $curscore $games_played) // Average score.
- atratio = (divf $atfrags $atdeaths) // All-time and/or Average Ratio? FIXME...
- if (= (curmodeattr team) 1) [ // Check if user is in a team mode.
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [
- if (= (curteam) 1) [ // If playing for RVSF, +1 to it's stat.
- += rvsfst 1
- ] [
- += 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) [ // If statements for holding the curmode acronym for the current round stats menu...
- modest = "TDM" // Store the acronym in alias "modest".
- // Only add to the mode/map counting stats if they are playing online or bot multiplayer...
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += tdmst 1] []] []
- ] [
- if (= $gamemode 2) [
- modest = "DM"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += dmst 1; += ffast 1] []] []
- ] [
- if (= $gamemode 4) [
- modest = "TSURV"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += tsvst 1] []] []
- ] [
- if (= $gamemode 3) [
- modest = "SURV"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += svst 1; += ffast 1] []] []
- ] [
- if (= $gamemode 5) [
- modest = "CTF"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += ctfst 1] []] []
- ] [
- if (= $gamemode 13) [
- modest = "HTF"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += htfst 1] []] []
- ] [
- if (= $gamemode 15) [
- modest = "KTF"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += ktfst 1; += ffast 1] []] []
- ] [
- if (= $gamemode 14) [
- modest = "TKTF"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += tktfst 1] []] []
- ] [
- if (= $gamemode 6) [
- modest = "PF"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += pfst 1; += ffast 1] []] []
- ] [
- if (= $gamemode 9) [
- modest = "LSS"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += lssst 1; += ffast 1] []] []
- ] [
- if (= $gamemode 10) [
- modest = "OSOK"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += osokst 1; += ffast 1] []] []
- ] [
- if (= $gamemode 11) [
- modest = "TOSOK"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += tosokst 1] []] []
- ] [
- if (= $gamemode 7) [
- modest = "BTDM"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += btdmst 1; += botst 1] []] []
- ] [
- if (= $gamemode 8) [
- modest = "BDM"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += bdmst 1; += ffast 1; += botst 1] []] []
- ] [
- if (= $gamemode 12) [
- modest = "BOSOK"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += bosokst 1; += ffast 1; += botst 1] []] []
- ] [
- if (= $gamemode 1) [
- modest = "COOP"
- if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += coopst 1] []] []
- ] []]]]]]]]]]]]]]]]
- if (= $mpst 0) [
- if (= (strcmp (curmap 1) ac_aqueous) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += aqueoussst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_arabian) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += arabianst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_arctic) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += arcticst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_arid) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += aridst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_complex) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += complexst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_depot) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += depotst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_desert) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += desertst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_desert2) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += desert2st 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_desert3) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += desert3st 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_douze) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += douzest 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_elevation) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += elevationst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_gothic) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += gothicst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_iceroad) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += iceroadst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_ingress) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += ingressst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_keller) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += kellerst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_mines) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += minesst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_outpost) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += outpostst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_power) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += powerst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_rattrap) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += rattrapst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_scaffold) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += scaffoldst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_shine) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += shinest 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_snow) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += snowst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_sunset) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += sunsetst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_toxic) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += toxicst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_urban) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += urbanst 1; += offmpst 1] []
- ] [
- if (= (strcmp (curmap 1) ac_werk) 1) [
- if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += werkst 1; += offmpst 1] []
- ] [+= cstmpst 1; mpst = 1]]]]]]]]]]]]]]]]]]]]]]]]]]] []
- ]
- clrst = [ // Function used to clear temporary stats holding and 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
- suicides = 0
- scoped = 0
- gmst = 0
- mpst = 0
- cksst = 0
- chksst = 0
- // cvflag = 0
- // dfflag = 0
- // suicides = 0
- // combo = 0
- // mcombo = 0
- ]
- clrats = [ // Function used to clear all-time statistics "on-the-fly" via user input.
- if (= $arg1 1) [
- atcfst = 0
- atdfst = 0
- athfst = 0
- atkfst = 0
- atlfst = 0
- atsfst = 0
- atfrags = 0
- atdeaths = 0
- atsuicides = 0
- atscore = 0
- atratio = 0
- atgbst = 0
- athsst = 0
- atknst = 0
- atspst = 0
- atftkst = 0
- athtkst = 0
- atstkst = 0
- atktkst = 0
- atgtkst = 0
- attkst = 0
- atsniper = 0
- atsniperdmg = 0
- atsmg = 0
- atsmgdmg = 0
- atar = 0
- atardmg = 0
- atshot = 0
- atshotdmg = 0
- atcarb = 0
- atcarbdmg = 0
- atusp = 0
- atuspdmg = 0
- ataki = 0
- atakidmg = 0
- atnade = 0
- atnadedmg = 0
- atknife = 0
- atknifedmg = 0
- acstart = 0
- atscoped = 0
- tdmst = 0
- dmst = 0
- tsvst = 0
- svst = 0
- ctfst = 0
- htfst = 0
- ktfst = 0
- tktfst = 0
- pfst = 0
- lssst = 0
- osokst = 0
- tosokst = 0
- btdmst = 0
- bdmst = 0
- bosokst = 0
- coopst = 0
- aqueousst = 0
- arabianst = 0
- arcticst = 0
- aridst = 0
- complexst = 0
- depotst = 0
- desertst = 0
- desert2st = 0
- desert3st = 0
- douzest = 0
- // edificest = 0
- elevationst = 0
- gothicst = 0
- iceroadst = 0
- // industrialst = 0
- ingressst = 0
- kellerst = 0
- minesst = 0
- outpostst = 0
- powerst = 0
- rattrapst = 0
- scaffoldst = 0
- shinest = 0
- snowst = 0
- sunsetst = 0
- toxicst = 0
- urbanst = 0
- werkst = 0
- rvsfst = 0
- clast = 0
- cstmpst = 0
- offmpst = 0
- athksst = 0
- ffast = 0
- botst = 0
- ] []
- ]
- stratvalues = [ // Function used for storing current round statistics to the all-time statistics if a proper
- // intermission was not given (i.e. admin forces new map) before clearing stats for the next
- // round.
- if (= $arg1 1) [
- += atfrags $curfrags // Calculate all-time stats. // TODO: Make it possible to add to these for on-the-fly all-time stats viewing.
- += atdeaths $curdeaths
- += atscore $curscore
- += atflags $curflags
- += atratio $curratio
- += atftkst $ftkst // Frag teamkills.
- += athtkst $htkst // Headshot teamkills.
- += atstkst $stkst // Splatter teamkills.
- += atktkst $ktkst // Knife teamkills.
- += atgtkst $gtkst // Grenade teamkills.
- += attkst $tkst // Total teamkills.
- += atsniper $cursniper // # of shots per weapon...
- += atsmg $cursmg
- += atar $curar
- += atshot $curshot
- += atcarb $curcarb
- += atusp $curusp
- += ataki $curaki
- += atnade $curnade
- += atknife $curknife
- += atsniperdmg $cursniperdmg // Per weapon damage stats...
- += atsmgdmg $cursmgdmg
- += atardmg $curardmg
- += atshotdmg $curshotdmg
- += atcarbdmg $curcarbdmg
- += atuspdmg $curuspdmg
- += atakidmg $curakidmg
- += atnadedmg $curnadedmg
- += atknifedmg $curknifedmg
- += atcfst $cfst // CTF flags.
- += atdfst $dfst // Dropped flags.
- += athfst $hfst // Hunted flags.
- += atkfst $kfst // Kept flags.
- += atlfst $lfst // Lost flags.
- += atsfst $sfst // Stolen flags.
- += atgbst $gbst // Grenade gibs.
- += athsst $hsst // Headshots.
- += atknst $knst // Knife gibs.
- += atspst $spst // Splatters...
- += atsuicides $suicides // Suicides...
- += atscoped $scoped // Scopes...
- if (> $chksst $athksst) [ // Highest ever kill streak...
- athksst = $chksst
- ] []
- atscoreavg = (divf $curscore $games_played) // Average score.
- atratio = (divf $atfrags $atdeaths) // All-time and/or Average Ratio? FIXME...
- ] []
- ]
- stats = [
- calc // Gather and calculate the stats.
- ocsize = $consize
- consize 100
- 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 1000 [consize $ocsize]
- ]]]
- get_stats = [ // Function used for gathering stats that pstat_score cannot access.
- // Loops every millisecond and scans the contents of the last line
- // on the console for various events. Therefore, some of the stats
- // collected via this method (the only method ATM) may not be 100%
- // accurate. For instance, double grenade gibs will only count 1,
- // because the events are happening simultaneously and CubeScript
- // currently cannot loop itself quickly enough for it to catch both
- // instances. For this exact same reason, we are unable to count your
- // flag covers, defences, combos, multi combos, etc. while you are
- // using /hudextras... Another project for the devs maybe? :P *hint*
- if (= (strstr $conline "3you fragged teammate") 1) [ // Frags on enemies.
- += tkst 1; += ftkst 1; conline [ ] // +1 to the total teamkill count, and the "frag teamkill" count.
- // Clear conline immediately after adding to the stats.
- ] [
- if (= (strstr $conline "3you headshotted teammate") 1) [ // Headshots on enemies.
- += tkst 1; += htkst 1; conline [ ]
- ] [
- if (= (strstr $conline "3you splattered teammate") 1) [ // Splatters on enemies.
- += tkst 1; += stkst 1; conline [ ]
- ] [
- if (= (strstr $conline "3you knifed teammate") 1) [ // Knife gibs on enemies.
- += tkst 1; += ktkst 1; conline [ ]
- ] [
- if (= (strstr $conline "3you gibbed teammate") 1) [ // Grenade gibs on enemies.
- += tkst 1; += gtkst 1; conline [ ]
- ] [
- if (&& (= (strstr $conline "you fragged") 1) (= (strstr $conline "3teammate") 0)) [ // Used for kill streaks...
- += cksst 1; conline [ ]
- ] [
- if (&& (= (strstr $conline "you headshotted") 1) (= (strstr $conline "3teammate") 0)) [ // Headshot TK's
- += hsst 1; += cksst 1; conline [ ]
- ] [
- if (&& (= (strstr $conline "you knifed") 1) (= (strstr $conline "3teammate") 0)) [ // Knife Gib TK's
- += knst 1; += cksst 1; conline [ ]
- ] [
- if (&& (= (strstr $conline "you splattered") 1) (= (strstr $conline "3teammate") 0)) [ // Splatter TK's
- += spst 1; += cksst 1; conline [ ]
- ] [
- if (&& (= (strstr $conline "you gibbed") 1) (= (strstr $conline "3teammate") 0)) [ // Grenade Gib TK's
- += gbst 1; += cksst 1; conline [ ]
- ] [
- if (&& (= (strcmp (at $conline 0) "2you") 1) (= (strstr $conline "got fragged by") 1)) [ // Used to reset kill streaks...
- cksst = 0; conline [ ]
- ] [
- if (&& (= (strcmp (at $conline 0) "2you") 1) (= (strstr $conline "got headshotted by") 1)) [
- cksst = 0; conline [ ]
- ] [
- if (&& (= (strcmp (at $conline 0) "2you") 1) (= (strstr $conline "got knifed by") 1)) [
- cksst = 0; conline [ ]
- ] [
- if (&& (= (strcmp (at $conline 0) "2you") 1) (= (strstr $conline "got splattered by") 1)) [
- cksst = 0; conline [ ]
- ] [
- if (&& (= (strcmp (at $conline 0) "2you") 1) (= (strstr $conline "got gibbed by") 1)) [
- cksst = 0; conline [ ]
- ] [
- if (= (strcmp $conline "2you got the enemy flag") 1) [ // Stolen flags.
- += sfst 1; conline [ ]
- ] [
- if (= (strcmp $conline "2you got the flag") 1) [
- += sfst 1; conline [ ]
- ] [
- if (= (strcmp $conline "2you dropped the flag") 1) [ // Dropped flags.
- += dfst 1; conline [ ]
- ] [
- if (= (strcmp $conline "2you lost the flag") 1) [ // Lost flags.
- += 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 "2you suicided!") 1) [ // Suicides...
- += suicides 1; cksst = 0; conline [ ]
- ] [
- ]]]]]]]]]]]]]]]]]]]]]]]
- if (> $cksst $chksst) [
- chksst = $cksst
- ] []
- sleep 1 [get_stats] // The loop...
- ]
- if (strstr $mapstartalways clrst) [] [ // Automate stuff :)
- add2alias mapstartalways [consize $ocsize; sleep 5 [if (= $strst 0) [stratvalues 1] []]; sleep 10 [clrst]; sleep 15 [get_stats]]
- add2alias start_intermission [stats]
- ]
- // A menu seemed like it would be the easiest and most asthetically pleasing method of displaying the stats...IDK
- newmenu "Current Round Statistics" // Current Round Stats Menu
- 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 "2Current KS: " "result $cksst"
- menuitemtextinput "2Highest KS: " "result $chksst"
- 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)]
- menuitemtextinput "2Scopes: " "result $scoped"
- menuitem "" -1
- menuitemvar [concat (c 4)Weapon stats are currently shots/damage.]
- newmenu "All-Time Statistics" // All-Time Stats Menu
- menuinit [(calc)]
- menuitemvar [concat (c 4)Here are your all-time statistics:]
- menuitem "" -1
- menuitemvar [concat (c 0) " ~Flags~"]
- menuitemtextinput "2Scored: " "result $atcfst" // CTF Flags
- //menuitemtextinput "2Covered: " "result $atcvflag"
- //menuitemtextinput "2Defended: " "result $atdfflag"
- menuitemtextinput "2Dropped: " "result $atdfst"
- menuitemtextinput "2Hunted: " "result $athfst" // HTF Flags
- menuitemtextinput "2Kept: " "result $atkfst" // TKTF/KTF Flags
- menuitemtextinput "3Lost: " "result $atlfst"
- menuitemtextinput "2Stolen: " "result $atsfst" // # of times carrying flag.
- menuitem "" -1
- menuitemvar [concat (c 3) " ~Kills~" ]
- menuitemtextinput "2Frags: " "result $atfrags"
- menuitemtextinput "3Deaths: " "result $atdeaths"
- menuitemtextinput "3Suicides: " "result $atsuicides"
- menuitemtextinput "2Score: " "result $atscore"
- //menuitemtextinput "2Combos: " "result $atcombo"
- //menuitemtextinput "2Multi-Combos: " "result $atmcombo"
- menuitemtextinput "2Ratio: " "result $atratio"
- menuitemtextinput "2Gibs: " "result $atgbst"
- menuitemtextinput "2Headshots: " "result $athsst"
- menuitemtextinput "2Knife Gibs: " "result $atknst"
- menuitemtextinput "2Splatters: " "result $atspst"
- menuitemtextinput "2Highest KS: " "result $athksst"
- menuitemtextinput "3FTK's: " "result $atftkst"
- menuitemtextinput "3HTK's: " "result $athtkst"
- menuitemtextinput "3STK's: " "result $atstkst"
- menuitemtextinput "3KTK's: " "result $atktkst"
- menuitemtextinput "3GTK's: " "result $atgtkst"
- menuitemtextinput "7Total TK's: " "result $attkst"
- menuitem "" -1
- menuitemvar [concat (c 1) " ~Weapons~" ]
- menuitemtextinput "2Sniper: " [(concatword $atsniper / $atsniperdmg)]
- menuitemtextinput "2SMG: " [(concatword $atsmg / $atsmgdmg)]
- menuitemtextinput "2AR: " [(concatword $atar / $atardmg)]
- menuitemtextinput "2Shotgun: " [(concatword $atshot / $atshotdmg)]
- menuitemtextinput "2Carbine: " [(concatword $atcarb / $atcarbdmg)]
- menuitemtextinput "2Pistol: " [(concatword $atusp / $atuspdmg)]
- menuitemtextinput "2Akimbo: " [(concatword $ataki / $atakidmg)]
- menuitemtextinput "2Grenade: " [(concatword $atnade / $atnadedmg)]
- menuitemtextinput "2Knife: " [(concatword $atknife / $atknifedmg)]
- menuitemtextinput "2Scopes: " "result $atscoped"
- menuitem "" -1
- menuitemvar [concat (c 4)Weapon stats are currently shots/damage.]
- menuitem "" -1
- menuitemvar [concat (c 6) " ~Modes~" ]
- menuitemtextinput "2TDM: " "result $tdmst"
- menuitemtextinput "2DM: " "result $dmst"
- menuitemtextinput "2TSURV: " "result $tsvst"
- menuitemtextinput "2SURV: " "result $svst"
- menuitemtextinput "2CTF: " "result $ctfst"
- menuitemtextinput "2HTF: " "result $htfst"
- menuitemtextinput "2TKTF: " "result $tktfst"
- menuitemtextinput "2KTF: " "result $ktfst"
- menuitemtextinput "2PF: " "result $pfst"
- menuitemtextinput "2LSS: " "result $lssst"
- menuitemtextinput "2TOSOK: " "result $tosokst"
- menuitemtextinput "2OSOK: " "result $osokst"
- menuitemtextinput "2BTDM: " "result $btdmst"
- menuitemtextinput "2BDM: " "result $bdmst"
- menuitemtextinput "2BOSOK: " "result $bosokst"
- menuitemtextinput "2COOP: " "result $coopst"
- menuitem "" -1
- menuitemvar [concat (c 7) " ~Maps~" ]
- menuitemtextinput "2ac_aqueous: " "result $aqueousst"
- menuitemtextinput "2ac_arabian: " "result $arabianst"
- menuitemtextinput "2ac_arctic: " "result $arcticst"
- menuitemtextinput "2ac_arid: " "result $aridst"
- menuitemtextinput "2ac_complex: " "result $complexst"
- menuitemtextinput "2ac_depot: " "result $depotst"
- menuitemtextinput "2ac_desert: " "result $desertst"
- menuitemtextinput "2ac_desert2: " "result $desert2st"
- menuitemtextinput "2ac_desert3: " "result $desert3st"
- menuitemtextinput "2ac_douze: " "result $douzest"
- //menuitemtextinput "2ac_edifice: " "result $edificest"
- menuitemtextinput "2ac_elevation: " "result $elevationst"
- menuitemtextinput "2ac_gothic: " "result $gothicst"
- menuitemtextinput "2ac_iceroad: " "result $iceroadst"
- //menuitemtextinput "2ac_industrial: " "result $industrialst"
- menuitemtextinput "2ac_ingress: " "result $ingressst"
- menuitemtextinput "2ac_keller: " "result $kellerst"
- menuitemtextinput "2ac_mines: " "result $minesst"
- menuitemtextinput "2ac_outpost: " "result $outpostst"
- menuitemtextinput "2ac_power: " "result $powerst"
- menuitemtextinput "2ac_rattrap: " "result $rattrapst"
- menuitemtextinput "2ac_scaffold: " "result $scaffoldst"
- menuitemtextinput "2ac_shine: " "result $shinest"
- menuitemtextinput "2ac_snow: " "result $snowst"
- menuitemtextinput "2ac_sunset: " "result $sunsetst"
- menuitemtextinput "2ac_toxic: " "result $toxicst"
- menuitemtextinput "2ac_urban: " "result $urbanst"
- menuitemtextinput "2ac_werk: " "result $werkst"
- menuitemtextinput "2Official: " "result $offmpst"
- menuitemtextinput "2Custom: " "result $cstmpst"
- menuitem "" -1
- menuitemvar [concat (c 0) " ~Other~" ]
- menuitemtextinput "2AC Starts: " "result $acstart"
- menuitemtextinput "3CLA: " "result $clast"
- menuitemtextinput "1RVSF: " "result $rvsfst"
- menuitemtextinput "4FFA: " "result $ffast"
- menuitemtextinput "2Bot: " "result $botst"
- showcurstatsbind = [ // Pre-built current round stats menu viewing alias for easy key binding...
- // Acts as a "toggle" bind similar to viewing the scoreboard. Press
- // and hold to view, release to close.
- calc // For accuracy purposes calculate updated statistics before showing the menu.
- showmenu "Current Round Statistics"
- onrelease [closemenu "Current Round Statistics"]
- ]
- showatstatsbind = [ // Pre-built all-time stats menu viewing alias for easy key binding...
- // Acts as a "toggle" bind similar to viewing the scoreboard. Press
- // and hold to view, release to close.
- calc // For accuracy purposes calculate updated statistics before showing the menu.
- showmenu "All-Time Statistics"
- onrelease [closemenu "All-Time Statistics"]
- ]
- statsmenu = [ // Command for showing the menus, IDK why people would not want to use the binds. :P
- if (strcmp $arg1 "all") [
- showmenu "All-Time Statistics"
- ] [
- showmenu "Current Round Statistics"
- ]
- ]
- bind BACKQUOTE [showcurstatsbind]
- bind EQUALS [showatstatsbind]
- docsection [MPL] // In-game documentation of the script's various commands.
- docident [clrst] [MPL: Clears the current round stats.]
- docexample [/clrst] []
- docident [clrats] [MPL: Clears the all-time stats.]
- docargument [A] [Clears the values only if this is set to 1.]
- docexample [/clrats 1] []
- docident [stats] [MPL: Prints your current round stats to the console.]
- docargument [A] [Prints your all time stats to the console if this is set to "all".]
- docexample [/stats] [Prints your current round stats.]
- docexample [/stats all] [Prints your all-time stats.]
- docident [statsmenu] [MPL: Shows your current round stats menu.]
- docargument [A] [Shows your all-time stats menu if this is set to "all".]
- docexample [/statsmenu] [Shows your current round stats menu.]
- docexample [/statsmenu all] [Shows your all-time stats menu.]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement