Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (checkalias atfrags) [] [ // Make stats collecting aliases if they do not already exist.
  2.     curflags = 0
  3.     atflags = 0
  4.     curfrags = 0
  5.     atfrags = 0
  6.     curdeaths = 0
  7.     atdeaths = 0
  8.     curscore = 0
  9.     atscore = 0
  10.     curratio = 0
  11.     atratio = 0
  12.     cursniper = 0
  13.     atsniper = 0
  14.     cursniperdmg = 0
  15.     atsniperdmg = 0
  16.     cursmg = 0
  17.     atsmg = 0
  18.     cursmgdmg = 0
  19.     atsmgdmg = 0
  20.     curshot = 0
  21.     atshot = 0
  22.     curshotdmg = 0
  23.     atshotdmg = 0
  24.     curar = 0
  25.     atar = 0
  26.     curardmg = 0
  27.     atardmg = 0
  28.     curcarb = 0
  29.     atcarb = 0
  30.     curcarbdmg = 0
  31.     atcarbdmg = 0
  32.     curusp = 0
  33.     atusp = 0
  34.     curuspdmg = 0
  35.     atuspdmg = 0
  36.     curaki = 0
  37.     ataki = 0
  38.     curakidmg = 0
  39.     atakidmg = 0
  40.     curknife = 0
  41.     atknife = 0
  42.     curknifedmg = 0
  43.     atknifedmg = 0
  44.     clast = 0
  45.     rvsfst = 0
  46.     games_played = 0
  47.     tkst = 0
  48.     attkst = 0
  49.     htkst = 0
  50.     athtkst = 0
  51.     stkst = 0
  52.     atstkst = 0
  53.     gtkst = 0
  54.     atgtkst = 0
  55.     ktkst = 0
  56.     atktkst = 0
  57.     ftkst = 0
  58.     atftkst = 0
  59.     hsst = 0
  60.     athsst = 0
  61.     knst = 0
  62.     atknst = 0
  63.     spst = 0
  64.     atspst = 0
  65.     gbst = 0
  66.     atgbst = 0
  67.     cfst = 0
  68.     atcfst = 0
  69.     dfst = 0
  70.     atdfst = 0
  71.     lfst = 0
  72.     atlfst = 0
  73.     kfst = 0
  74.     atkfst = 0
  75.     sfst = 0
  76.     atsfst = 0
  77.     suicides = 0
  78.     atsuicides = 0
  79.     cvflag = 0
  80.     atcvflag = 0
  81.     dfflag = 0
  82.     atdfflag = 0
  83.     combo = 0
  84.     atcombo = 0
  85.     mcombo = 0
  86.     atmcombo = 0
  87. ]
  88.  
  89. addcheck_si [+= games_played 1]
  90.  
  91. calc = [ // Function used for gathering and calculating stats
  92.     curflags = (at (pstat_score (findcn $curname)) 0)
  93.     curfrags = (at (pstat_score (findcn $curname)) 1)
  94.     curdeaths = (at (pstat_score (findcn $curname)) 2)
  95.     curscore = (at (pstat_score (findcn $curname)) 3)
  96.     cursniper = (at (pstat_weap (findcn $curname)) 10)
  97.     cursniperdmg = (at (pstat_weap (findcn $curname)) 11)
  98.     cursmg = (at (pstat_weap (findcn $curname)) 8)
  99.     cursmgdmg = (at (pstat_weap (findcn $curname)) 9)
  100.     curar = (at (pstat_weap (findcn $curname)) 12)
  101.     curardmg = (at (pstat_weap (findcn $curname)) 13)
  102.     curshot = (at (pstat_weap (findcn $curname)) 6)
  103.     curshotdmg = (at (pstat_weap (findcn $curname)) 7)
  104.     curcarb = (at (pstat_weap (findcn $curname)) 4)
  105.     curcarbdmg = (at (pstat_weap (findcn $curname)) 5)
  106.     curusp = (at (pstat_weap (findcn $curname)) 2)
  107.     curuspdmg = (at (pstat_weap (findcn $curname)) 3)
  108.     curaki = (at (pstat_weap (findcn $curname)) 18)
  109.     curakidmg = (at (pstat_weap (findcn $curname)) 19)
  110.     curnade = (at (pstat_weap (findcn $curname)) 16)
  111.     curnadedmg = (at (pstat_weap (findcn $curname)) 17)
  112.     curknife = (at (pstat_weap (findcn $curname)) 0)
  113.     curknifedmg = (at (pstat_weap (findcn $curname)) 1)
  114.     curratio = (divf $curfrags $curdeaths)
  115.         // if (&& (<= $minutesremaining 0) (= $strst 0)) [ // Add current score to all-time totals during intermission.
  116.         += atfrags $curfrags                        // TODO: Make it possible to add to these for on-the-fly all-time stats viewing.
  117.         += atdeaths $curdeaths
  118.         += atscore $curscore
  119.         += atflags $curflags
  120.         += atratio $curratio
  121.         += atftkst $ftkst // Frag teamkills.
  122.         += athtkst $htkst // Headshot teamkills.
  123.         += atstkst $stkst // Splatter teamkills.
  124.         += atktkst $ktkst // Knife teamkills.
  125.         += atgtkst $gtkst // Grenade teamkills.
  126.         += attkst $tkst // Total teamkills.
  127.         += atsniper $cursniper // # of shots per weapon...
  128.         += atsmg $cursmg
  129.         += atar $curar
  130.         += atshot $curshot
  131.         += atcarb $curcarb
  132.         += atusp $curusp
  133.         += ataki $curaki
  134.         += atnade $curnade
  135.         += atknife $curknife
  136.         += atcfst $cfst // CTF flags.
  137.         += atdfst $dfst // Dropped flags.
  138.         += athfst $hfst // Hunted flags.
  139.         += atkfst $kfst // Kept flags.
  140.         += atlfst $lfst // Lost flags.
  141.         += atsfst $sfst // Stolen flags.
  142.         += atgbst $gbst // Grenade gibs.
  143.         += athsst $hsst // Headshots.
  144.         += atknst $knst // Knife gibs.
  145.         += atspst $spst // Splatters...
  146.         += atsuicides $suicides // Suicides...
  147.         atscoreavg = (divf $curscore $games_played) // Average score.
  148.         atratio = (divf $atfrags $atdeaths) // All-time and/or Average Ratio? FIXME...
  149.     if (= (curmodeattr team) 1) [ // Check if user is in a team mode.
  150.         if (= (curteam) 1) [ // If playing for RVSF, +1 to it's stat.
  151.             += rvsfst 1
  152. // 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
  153.         ] [
  154.             += clast 1 // Else they are playing for CLA, +1 to it's stat.
  155.         ]] []
  156.     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.
  157.         // ] []
  158.     if (= $gamemode 0) [ // If statements for holding the curmode acronym for the current round stats menu...
  159.         modest = "TDM"
  160.     ] [
  161.     if (= $gamemode 2) [
  162.         modest = "DM"
  163.     ] [
  164.     if (= $gamemode 4) [
  165.         modest = "TSURV"
  166.     ] [
  167.     if (= $gamemode 3) [
  168.         modest = "SURV"
  169.     ] [
  170.     if (= $gamemode 5) [
  171.         modest = "CTF"
  172.     ] [
  173.     if (= $gamemode 13) [
  174.         modest = "HTF"
  175.     ] [
  176.     if (= $gamemode 15) [
  177.         modest = "KTF"
  178.     ] [
  179.     if (= $gamemode 14) [
  180.         modest = "TKTF"
  181.     ] [
  182.     if (= $gamemode 6) [
  183.         modest = "PF"
  184.     ] [
  185.     if (= $gamemode 9) [
  186.         modest = "LSS"
  187.     ] [
  188.     if (= $gamemode 10) [
  189.         modest = "OSOK"
  190.     ] [
  191.     if (= $gamemode 11) [
  192.         modest = "TOSOK"
  193.     ] [
  194.     if (= $gamemode 7) [
  195.         modest = "BTDM"
  196.     ] [
  197.     if (= $gamemode 8) [
  198.         modest = "BDM"
  199.     ] [
  200.     if (= $gamemode 12) [
  201.         modest = "BOSOK"
  202.     ] [
  203.     if (= $gamemode 1) [
  204.         modest = "COOP"
  205.     ] []]]]]]]]]]]]]]]]
  206. ]
  207.  
  208. clrst = [ // Function used to clear temporary script flow aliases on every map start.
  209.     strst = 0
  210.     hsst = 0
  211.     knst = 0
  212.     spst = 0
  213.     gbst = 0
  214.     cfst = 0
  215.     dfst = 0
  216.     lfst = 0
  217.     kfst = 0
  218.     sfst = 0
  219.     tkst = 0
  220.     htkst = 0
  221.     ktkst = 0
  222.     ftkst = 0
  223.     gtkst = 0
  224.     stkst = 0
  225.     cvflag = 0
  226.     dfflag = 0
  227.     suicides = 0
  228.     combo = 0
  229.     mcombo = 0
  230. ]
  231.  
  232. stats = [
  233.     calc // Gather and calculate the stats.
  234.     ocsize = $consize
  235.         if (strcmp $arg1 "all") [ // If user entered "all" as the first argument display the all-time stats instead.
  236.             echo ""
  237.             echo All-Time Frags: $atfrags
  238.             echo All-Time Deaths: $atdeaths
  239.             echo All-Time Score: $atscore
  240.         if (< $atdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
  241.             echo All-Time Ratio: (concatword $atfrags .0)
  242.         ] [
  243.             echo All-Time Ratio: $atratio
  244.         ]
  245.             echo CLA: $clast
  246.             echo RVSF: $rvsfst
  247.         ] [ // Else show user the current round stats.
  248.             consize 24
  249.             echo ""
  250.             echo Flags: $curflags
  251.             echo Frags: $curfrags
  252.             echo Deaths: $curdeaths
  253.         if (= $connected 1) [ // Score is only calculated in multiplayer.
  254.             echo Score: $curscore
  255.         ] [
  256.             echo Score: N/A
  257.         ]
  258.         if (< $curdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
  259.             echo Ratio: (concatword $curfrags .0)
  260.         ] [
  261.             echo Ratio: $curratio
  262.         ]
  263.             echo FTK's: $ftkst
  264.             echo HTK's: $htkst
  265.             echo STK's: $htkst
  266.             echo KTK's: $ktkst
  267.             echo GTK's: $gtkst
  268.             echo Total TK's: $tkst
  269.             echo ""
  270.         if (= $connected 1) [ // Weapon damage is only shown in multiplayer, for some reason. :(
  271.             echo Sniper: (concatword $cursniper / $cursniperdmg)
  272.             echo SMG: (concatword $cursmg / $cursmgdmg)
  273.             echo AR: (concatword $curar / $curardmg)
  274.             echo Shotgun: (concatword $curshot / $curshotdmg)
  275.             echo Carbine: (concatword $curcarb / $curcarbdmg)
  276.             echo Pistol: (concatword $curusp / $curuspdmg)
  277.             echo Akimbo: (concatword $curaki / $curakidmg)
  278.             echo Grenade: (concatword $curnade / $curnadedmg)
  279.             echo Knife: (concatword $curknife / $curknifedmg)
  280.             echo ""
  281.             echo Weapon stats are currently shots/damage.
  282.         ] [
  283.             echo Sniper: $cursniper
  284.             echo SMG: $cursmg
  285.             echo AR: $curar
  286.             echo Shotgun: $curshot
  287.             echo Carbine: $curcarb
  288.             echo Pistol: $curusp
  289.             echo Akimbo: $curaki
  290.             echo Grenade: $curnade
  291.             echo Knife: $curknife
  292.             echo ""
  293.             echo Weapon stats for SP are currently # of shots fired.
  294.     sleep 10000 [consize $ocsize]
  295. ]]]
  296.  
  297. get_stats = [ // Function used for gathering stats that pstat_score cannot access.
  298.     if (= (strstr $conline " 3you fragged teammate") 1) [
  299.         += tkst 1; += ftkst 1; conline [  ]
  300.     ] [
  301.     if (= (strstr $conline " 3you headshotted teammate") 1) [
  302.         += tkst 1; += htkst 1; conline [  ]
  303.     ] [
  304.     if (= (strstr $conline " 3you splattered teammate") 1) [
  305.         += tkst 1; += stkst 1; conline [  ]
  306.     ] [
  307.     if (= (strstr $conline " 3you knifed teammate") 1) [
  308.         += tkst 1; += ktkst 1; conline [  ]
  309.     ] [
  310.     if (= (strstr $conline " 3you gibbed teammate") 1) [
  311.         += tkst 1; += gtkst 1; conline [  ]
  312.     ] [
  313.     if (&& (= (strstr $conline "you headshotted") 1) (= (strstr $conline " 3teammate") 0)) [
  314.         += hsst 1; conline [  ]
  315.     ] [
  316.     if (&& (= (strstr $conline "you knifed") 1) (= (strstr $conline " 3teammate") 0)) [
  317.         += knst 1; conline [  ]
  318.     ] [
  319.     if (&& (= (strstr $conline "you splattered") 1) (= (strstr $conline " 3teammate") 0)) [
  320.         += spst 1; conline [  ]
  321.     ] [
  322.     if (&& (= (strstr $conline "you gibbed") 1) (= (strstr $conline " 3teammate") 0)) [
  323.         += gbst 1; conline [  ]
  324.     ] [
  325.     if (= (strcmp $conline " 2you got the enemy flag") 1) [
  326.         += sfst 1; conline [  ]
  327.     ] [
  328.     if (= (strcmp $conline " 2you got the flag") 1) [
  329.         += sfst 1; conline [  ]
  330.     ] [
  331.     if (= (strcmp $conline " 2you dropped the flag") 1) [
  332.         += dfst 1; conline [  ]
  333.     ] [
  334.     if (= (strcmp $conline " 2you lost the flag") 1) [
  335.         += lfst 1; conline [  ]
  336.     ] [
  337.     if (= (strstr $conline " 2you have kept the flag for") 1) [ // TKTF/KTF Flags
  338.         += kfst 1; conline [  ]
  339.     ][
  340.     if (&& (= $gamemode 5) (= (strcmp $conline " 2you scored") 1)) [ // CTF Flags
  341.         += cfst 1; conline [  ]
  342.     ] [
  343.     if (&& (= $gamemode 13) (= (strcmp $conline " 2you scored") 1)) [ // HTF Flags
  344.         += hfst 1; conline [  ]
  345.     ] [
  346.     if (= (strcmp $conline " 2you suicided!") 1) [
  347.         += suicides 1; conline [  ]
  348.     ] [
  349.     ]]]]]]]]]]]]]]]]]
  350.     sleep 1 [get_stats]
  351. ]
  352.  
  353. if (strstr $mapstartalways clrst) [] [ // Automate stuff :)
  354.     add2alias mapstartalways [clrst; sleep 3 [get_stats]]
  355.     add2alias start_intermission [stats]
  356. ]
  357.  
  358. newmenu "Current Round Statistics"
  359. menuinit [(calc)]
  360. menuitemvar [concat (c 4)Here are your stats for $modest (concatword (curmap 1) :)]
  361. menuitem "" -1
  362. menuitemvar [concat (c 0) "        ~Flags~"]
  363. menuitemtextinput " 2Scored: " "result $cfst" // CTF Flags
  364. //menuitemtextinput " 2Covered: " "result $cvflag"
  365. //menuitemtextinput " 2Defended: " "result $dfflag"
  366. menuitemtextinput " 2Dropped: " "result $dfst"
  367. menuitemtextinput " 2Hunted: " "result $hfst" // HTF Flags
  368. menuitemtextinput " 2Kept: " "result $kfst"   // TKTF/KTF Flags
  369. menuitemtextinput " 3Lost: " "result $lfst"
  370. menuitemtextinput " 2Stolen: " "result $sfst" // # of times carrying flag.
  371. menuitem "" -1
  372. menuitemvar [concat (c 3) "        ~Kills~" ]
  373. menuitemtextinput " 2Frags: " "result $curfrags"
  374. menuitemtextinput " 3Deaths: " "result $curdeaths"
  375. menuitemtextinput " 3Suicides: " "result $suicides"
  376. menuitemtextinput " 2Score: " "result $curscore"
  377. //menuitemtextinput " 2Combos: " "result $combo"
  378. //menuitemtextinput " 2Multi-Combos: " "result $mcombo"
  379. menuitemtextinput " 2Ratio: " "result $curratio"
  380. menuitemtextinput " 2Gibs: " "result $gbst"
  381. menuitemtextinput " 2Headshots: " "result $hsst"
  382. menuitemtextinput " 2Knife Gibs: " "result $knst"
  383. menuitemtextinput " 2Splatters: " "result $spst"
  384. menuitemtextinput " 3FTK's: " "result $ftkst"
  385. menuitemtextinput " 3HTK's: " "result $htkst"
  386. menuitemtextinput " 3STK's: " "result $stkst"
  387. menuitemtextinput " 3KTK's: " "result $ktkst"
  388. menuitemtextinput " 3GTK's: " "result $gtkst"
  389. menuitemtextinput " 7Total TK's: " "result $tkst"
  390. menuitem "" -1
  391. menuitemvar [concat (c 1) "      ~Weapons~" ]
  392. menuitemtextinput " 2Sniper: " [(concatword $cursniper / $cursniperdmg)]
  393. menuitemtextinput " 2SMG: " [(concatword $cursmg / $cursmgdmg)]
  394. menuitemtextinput " 2AR: " [(concatword $curar / $curardmg)]
  395. menuitemtextinput " 2Shotgun: " [(concatword $curshot / $curshotdmg)]
  396. menuitemtextinput " 2Carbine: " [(concatword $curcarb / $curcarbdmg)]
  397. menuitemtextinput " 2Pistol: " [(concatword $curusp / $curuspdmg)]
  398. menuitemtextinput " 2Akimbo: " [(concatword $curaki / $curakidmg)]
  399. menuitemtextinput " 2Grenade: " [(concatword $curnade / $curnadedmg)]
  400. menuitemtextinput " 2Knife: " [(concatword $curknife / $curknifedmg)]
  401. menuitem "" -1
  402. menuitemvar [concat (c 4)Weapon stats are currently shots/damage.]
  403.  
  404. newmenu "All-Time Statistics"
  405. menuinit [(calc)]
  406. menuitemvar [concat (c 4)Here are your all-time statistics:]
  407. menuitem "" -1
  408. menuitemvar [concat (c 0) "        ~Flags~"]
  409. menuitemtextinput " 2Scored: " "result $atcfst" // CTF Flags
  410. //menuitemtextinput " 2Covered: " "result $atcvflag"
  411. //menuitemtextinput " 2Defended: " "result $atdfflag"
  412. menuitemtextinput " 2Dropped: " "result $atdfst"
  413. menuitemtextinput " 2Hunted: " "result $athfst" // HTF Flags
  414. menuitemtextinput " 2Kept: " "result $atkfst"   // TKTF/KTF Flags
  415. menuitemtextinput " 3Lost: " "result $atlfst"
  416. menuitemtextinput " 2Stolen: " "result $atsfst" // # of times carrying flag.
  417. menuitem "" -1
  418. menuitemvar [concat (c 3) "        ~Kills~" ]
  419. menuitemtextinput " 2Frags: " "result $atfrags"
  420. menuitemtextinput " 3Deaths: " "result $atdeaths"
  421. menuitemtextinput " 3Suicides: " "result $atsuicides"
  422. menuitemtextinput " 2Score: " "result $atscore"
  423. //menuitemtextinput " 2Combos: " "result $atcombo"
  424. //menuitemtextinput " 2Multi-Combos: " "result $atmcombo"
  425. menuitemtextinput " 2Ratio: " "result $atratio"
  426. menuitemtextinput " 2Gibs: " "result $atgbst"
  427. menuitemtextinput " 2Headshots: " "result $athsst"
  428. menuitemtextinput " 2Knife Gibs: " "result $atknst"
  429. menuitemtextinput " 2Splatters: " "result $atspst"
  430. menuitemtextinput " 3FTK's: " "result $atftkst"
  431. menuitemtextinput " 3HTK's: " "result $athtkst"
  432. menuitemtextinput " 3STK's: " "result $atstkst"
  433. menuitemtextinput " 3KTK's: " "result $atktkst"
  434. menuitemtextinput " 3GTK's: " "result $atgtkst"
  435. menuitemtextinput " 7Total TK's: " "result $attkst"
  436. menuitem "" -1
  437. menuitemvar [concat (c 1) "      ~Weapons~" ]
  438. menuitemtextinput " 2Sniper: " [(concatword $atsniper / $atsniperdmg)]
  439. menuitemtextinput " 2SMG: " [(concatword $atsmg / $atsmgdmg)]
  440. menuitemtextinput " 2AR: " [(concatword $atar / $atardmg)]
  441. menuitemtextinput " 2Shotgun: " [(concatword $atshot / $atshotdmg)]
  442. menuitemtextinput " 2Carbine: " [(concatword $atcarb / $atcarbdmg)]
  443. menuitemtextinput " 2Pistol: " [(concatword $atusp / $atuspdmg)]
  444. menuitemtextinput " 2Akimbo: " [(concatword $ataki / $atakidmg)]
  445. menuitemtextinput " 2Grenade: " [(concatword $atnade / $atnadedmg)]
  446. menuitemtextinput " 2Knife: " [(concatword $atknife / $atknifedmg)]
  447. menuitem "" -1
  448. menuitemvar [concat (c 4)Weapon stats are currently shots/damage.]
  449.  
  450. showcurstatsbind = [ // Pre-built alias that users can bind to a key for easy menu viewing.
  451.     calc
  452.     showmenu "Current Round Statistics"
  453.     onrelease [closemenu "Current Round Statistics"]
  454. ]
  455.  
  456. bind BACKQUOTE [showcurstatsbind]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement