Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
69
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.     cursniperdmg = 0
  14.     cursmg = 0
  15.     cursmgdmg = 0
  16.     curshot = 0
  17.     curshotdmg = 0
  18.     curar = 0
  19.     curardmg = 0
  20.     curcarb = 0
  21.     curcarbdmg = 0
  22.     curusp = 0
  23.     curuspdmg = 0
  24.     curaki = 0
  25.     curakidmg = 0
  26.     curknife = 0
  27.     curknifedmg = 0
  28.     clast = 0
  29.     rvsfst = 0
  30.     games_played = 0
  31.     tkst = 0
  32.     htkst = 0
  33.     stkst = 0
  34.     gtkst = 0
  35.     ktkst = 0
  36.     ftkst = 0
  37. ]
  38.  
  39. addcheck_si [+= games_played 1]
  40.  
  41. calc = [ // Function used for gathering and calculating stats
  42.     curflags = (at (pstat_score (findcn $curname)) 0)
  43.     curfrags = (at (pstat_score (findcn $curname)) 1)
  44.     curdeaths = (at (pstat_score (findcn $curname)) 2)
  45.     curscore = (at (pstat_score (findcn $curname)) 3)
  46.     cursniper = (at (pstat_weap (findcn $curname)) 10)
  47.     cursniperdmg = (at (pstat_weap (findcn $curname)) 11)
  48.     cursmg = (at (pstat_weap (findcn $curname)) 8)
  49.     cursmgdmg = (at (pstat_weap (findcn $curname)) 9)
  50.     curar = (at (pstat_weap (findcn $curname)) 12)
  51.     curardmg = (at (pstat_weap (findcn $curname)) 13)
  52.     curshot = (at (pstat_weap (findcn $curname)) 6)
  53.     curshotdmg = (at (pstat_weap (findcn $curname)) 7)
  54.     curcarb = (at (pstat_weap (findcn $curname)) 4)
  55.     curcarbdmg = (at (pstat_weap (findcn $curname)) 5)
  56.     curusp = (at (pstat_weap (findcn $curname)) 2)
  57.     curuspdmg = (at (pstat_weap (findcn $curname)) 3)
  58.     curaki = (at (pstat_weap (findcn $curname)) 18)
  59.     curakidmg = (at (pstat_weap (findcn $curname)) 19)
  60.     curnade = (at (pstat_weap (findcn $curname)) 16)
  61.     curnadedmg = (at (pstat_weap (findcn $curname)) 17)
  62.     curknife = (at (pstat_weap (findcn $curname)) 0)
  63.     curknifedmg = (at (pstat_weap (findcn $curname)) 1)
  64.     curratio = (divf $curfrags $curdeaths)
  65. //      if (&& (<= $minutesremaining 0) (= $strst 0)) [ // Add current score to all-time totals during intermission.
  66.             += atfrags $curfrags                        // TODO: Make it possible to add to these for on-the-fly all-time stats viewing.
  67.             += atdeaths $curdeaths
  68.             += atscore $curscore
  69.             += atflags $curflags
  70.             atscoreavg = (divf $curscore $games_played)
  71.             atratio = (divf $atfrags $atdeaths)
  72.                 if (= (curmodeattr team) 1) [ // Check if user is in a team mode.
  73.                     if (= (curteam) 1) [ // If playing for RVSF, +1 to it's stat.
  74.                         += rvsfst 1
  75. // 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
  76.                     ] [
  77.                         += clast 1 // Else they are playing for CLA, +1 to it's stat.
  78.                 ]] []
  79.             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.
  80. //      ] []
  81.     if (= $gamemode 0) [
  82.         modest = "TDM"
  83.     ][
  84.     if (= $gamemode 2) [
  85.         modest = "DM"
  86.     ][
  87.     if (= $gamemode 4) [
  88.         modest = "TSURV"
  89.     ][
  90.     if (= $gamemode 3) [
  91.         modest = "SURV"
  92.     ][
  93.     if (= $gamemode 5) [
  94.         modest = "CTF"
  95.     ][
  96.     if (= $gamemode 13) [
  97.         modest = "HTF"
  98.     ][
  99.     if (= $gamemode 15) [
  100.         modest = "KTF"
  101.     ][
  102.     if (= $gamemode 14) [
  103.         modest = "TKTF"
  104.     ][
  105.     if (= $gamemode 6) [
  106.         modest = "PF"
  107.     ][
  108.     if (= $gamemode 9) [
  109.         modest = "LSS"
  110.     ][
  111.     if (= $gamemode 10) [
  112.         modest = "OSOK"
  113.     ][
  114.     if (= $gamemode 11) [
  115.         modest = "TOSOK"
  116.     ][
  117.     if (= $gamemode 7) [
  118.         modest = "BTDM"
  119.     ][
  120.     if (= $gamemode 8) [
  121.         modest = "BDM"
  122.     ][
  123.     if (= $gamemode 12) [
  124.         modest = "BOSOK"
  125.     ][
  126.     if (= $gamemode 1) [
  127.         modest = "COOP"
  128.     ] []]]]]]]]]]]]]]]]
  129. ]
  130.  
  131. clrst = [ // Function used to clear temporary script flow aliases on every map start.
  132.     strst = 0
  133. ]
  134.  
  135. stats = [
  136.     calc // Gather and calculate the stats.
  137.         if (strcmp $arg1 "all") [ // If user entered "all" as the first argument display the all-time stats instead.
  138.             echo All-Time Frags: $atfrags
  139.             echo All-Time Deaths: $atdeaths
  140.             echo All-Time Score: $atscore
  141.                 if (< $atdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
  142.             echo All-Time Ratio: (concatword $atfrags .0)
  143.             ] [
  144.             echo All-Time Ratio: $atratio
  145.             ]
  146.             echo CLA: $clast
  147.             echo RVSF: $rvsfst
  148.         ] [ // Else show user the current round stats.
  149.         echo Frags: $curfrags
  150.         echo Deaths: $curdeaths
  151.             if (= $connected 1) [ // Score is only calculated in multiplayer.
  152.         echo Score: $curscore
  153.     ] [
  154.         echo Score: N/A
  155.     ]
  156.             if (< $curdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
  157.         echo Ratio: (concatword $curfrags .0)
  158.     ] [
  159.         echo Ratio: $curratio
  160. ]]]
  161.  
  162. get_stats = [ // Function used for gathering stats that pstat_score cannot access.
  163.     if (= (strstr $conline " 3you fragged teammate") 1) [ // team kills
  164.         += tkst 1; += ftkst 1; conline [  ]
  165.         ] [
  166.     if (= (strstr $conline " 3you headshotted teammate") 1) [
  167.         += tkst 1; += htkst 1; conline [  ]
  168.     ] [
  169.     if (= (strstr $conline " 3you splattered teammate") 1) [
  170.         += tkst 1; += stkst 1; conline [  ]
  171.     ] [
  172.     if (= (strstr $conline " 3you knifed teammate") 1) [
  173.         += tkst 1; += ktkst 1; conline [  ]
  174.     ] [
  175.     if (= (strstr $conline " 3you gibbed teammate") 1) [
  176.         += tkst 1; += gtkst 1; conline [  ]
  177.     ] []
  178.     sleep 1 [get_stats]
  179. ]]]]]
  180.  
  181. if (strstr $mapstartalways clrst) [] [ // Automate stuff :)
  182.     add2alias mapstartalways [clrst; sleep 3 [get_stats]]
  183.     add2alias start_intermission [stats]
  184. ]
  185.  
  186. newmenu "Current Round Statistics"
  187. menuinit [(calc)]
  188. menuitemvar [concat Here are your stats for $modest (concatword (curmap 1) :)]
  189. menuitem "" -1
  190. menuitemtextinput "Flags: " "result $curflags"
  191. menuitemtextinput "Frags: " "result $curfrags"
  192. menuitemtextinput "Deaths: " "result $curdeaths"
  193. menuitemtextinput "Score: " "result $curscore"
  194. menuitemtextinput "Ratio: " "result $curratio"
  195. menuitemtextinput "FTK's: " "result $ftkst"
  196. menuitemtextinput "HTK's: " "result $htkst"
  197. menuitemtextinput "STK's: " "result $stkst"
  198. menuitemtextinput "KTK's: " "result $ktkst"
  199. menuitemtextinput "GTK's: " "result $gtkst"
  200. menuitemtextinput "Total TK's: " "result $tkst"
  201. menuitem "" -1
  202. menuitemtextinput "Sniper: " [(concatword $cursniper / $cursniperdmg)]
  203. menuitemtextinput "SMG: " [(concatword $cursmg / $cursmgdmg)]
  204. menuitemtextinput "AR: " [(concatword $curar / $curardmg)]
  205. menuitemtextinput "Shotgun: " [(concatword $curshot / $curshotdmg)]
  206. menuitemtextinput "Carbine: " [(concatword $curcarb / $curcarbdmg)]
  207. menuitemtextinput "Pistol: " [(concatword $curusp / $curuspdmg)]
  208. menuitemtextinput "Akimbo: " [(concatword $curaki / $curakidmg)]
  209. menuitemtextinput "Grenade: " [(concatword $curnade / $curnadedmg)]
  210. menuitemtextinput "Knife: " [(concatword $curknife / $curknifedmg)]
  211. menuitem "" -1
  212. menuitem "Weapon stats are currently shots/damage." -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement