Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.07 KB | None | 0 0
  1. if (= (strcmp $altaction_5 " setscope 1; onrelease [ setscope 0 ] ") 1) [ // Add # of times scoped counter to altaction_5...
  2. altaction_5 = [setscope 1; += scoped 1; onrelease [ setscope 0 ]]
  3. ] []
  4.  
  5. if (checkalias atfrags) [] [ // Make stats collecting aliases if they do not already exist.
  6. curflags = 0
  7. atflags = 0
  8. curfrags = 0
  9. atfrags = 0
  10. curdeaths = 0
  11. atdeaths = 0
  12. curscore = 0
  13. atscore = 0
  14. curratio = 0
  15. atratio = 0
  16. cursniper = 0 // Weapon shots, damages, etc.
  17. atsniper = 0
  18. cursniperdmg = 0
  19. atsniperdmg = 0
  20. cursmg = 0
  21. atsmg = 0
  22. cursmgdmg = 0
  23. atsmgdmg = 0
  24. curshot = 0
  25. atshot = 0
  26. curshotdmg = 0
  27. atshotdmg = 0
  28. curar = 0
  29. atar = 0
  30. curardmg = 0
  31. atardmg = 0
  32. curcarb = 0
  33. atcarb = 0
  34. curcarbdmg = 0
  35. atcarbdmg = 0
  36. curusp = 0
  37. atusp = 0
  38. curuspdmg = 0
  39. atuspdmg = 0
  40. curnade = 0
  41. atnade = 0
  42. curnadedmg = 0
  43. atnadedmg = 0
  44. curaki = 0
  45. ataki = 0
  46. curakidmg = 0
  47. atakidmg = 0
  48. curknife = 0
  49. atknife = 0
  50. curknifedmg = 0
  51. atknifedmg = 0
  52. clast = 0 // # of times played as CLA.
  53. rvsfst = 0 // # of times played as RVSF.
  54. games_played = 0 // Total # of games played.
  55. tkst = 0 // Teamkills...
  56. attkst = 0
  57. htkst = 0
  58. athtkst = 0
  59. stkst = 0
  60. atstkst = 0
  61. gtkst = 0
  62. atgtkst = 0
  63. ktkst = 0
  64. atktkst = 0
  65. ftkst = 0
  66. atftkst = 0
  67. hsst = 0 // Kills...
  68. athsst = 0
  69. knst = 0
  70. atknst = 0
  71. spst = 0
  72. atspst = 0
  73. gbst = 0
  74. atgbst = 0
  75. cfst = 0 // Flags...
  76. atcfst = 0
  77. dfst = 0
  78. atdfst = 0
  79. hfst = 0
  80. athfst = 0
  81. lfst = 0
  82. atlfst = 0
  83. kfst = 0
  84. atkfst = 0
  85. sfst = 0
  86. atsfst = 0
  87. suicides = 0 // Suicides...
  88. atsuicides = 0
  89. gmst = 0
  90. mpst = 0
  91. tdmst = 0
  92. dmst = 0
  93. tsvst = 0
  94. svst = 0
  95. ctfst = 0
  96. htfst = 0
  97. ktfst = 0
  98. tktfst = 0
  99. pfst = 0
  100. lssst = 0
  101. osokst = 0
  102. tosokst = 0
  103. btdmst = 0
  104. bdmst = 0
  105. bosokst = 0
  106. coopst = 0
  107. aqueousst = 0
  108. arabianst = 0
  109. arcticst = 0
  110. aridst = 0
  111. complexst = 0
  112. depotst = 0
  113. desertst = 0
  114. desert2st = 0
  115. desert3st = 0
  116. douzest = 0
  117. // edificest = 0
  118. elevationst = 0
  119. gothicst = 0
  120. iceroadst = 0
  121. // industrialst = 0
  122. ingressst = 0
  123. kellerst = 0
  124. minesst = 0
  125. outpostst = 0
  126. powerst = 0
  127. rattrapst = 0
  128. scaffoldst = 0
  129. shinest = 0
  130. snowst = 0
  131. sunsetst = 0
  132. toxicst = 0
  133. urbanst = 0
  134. werkst = 0
  135. // cvflag = 0 // Cry... :(
  136. // atcvflag = 0
  137. // dfflag = 0
  138. // atdfflag = 0
  139. // combo = 0
  140. // atcombo = 0
  141. // mcombo = 0
  142. // atmcombo = 0
  143. acstart = 0 // # of AC launches...
  144. scoped = 0 // # of times scoped with the sniper rifle.
  145. atscoped = 0
  146. rvsfst = 0 // # of times playing for each team stats.
  147. clast = 0
  148. offmpst = 0 // # of times playing official or non-official maps stats.
  149. cstmpst = 0
  150. cksst = 0
  151. chksst = 0
  152. athksst = 0
  153. ocsize = $consize
  154. ffast = 0
  155. botst = 0
  156. ]
  157.  
  158. += acstart 1 // # of times started AC stat, cheap way of doing it I must admit. 8)
  159.  
  160. // addcheck_si [+= games_played 1]
  161.  
  162. calc = [ // Function used for gathering and calculating stats.
  163. curflags = (at (pstat_score (findcn $curname)) 0) // Pull as much stuff from pstat as possible.
  164. curfrags = (at (pstat_score (findcn $curname)) 1)
  165. curdeaths = (at (pstat_score (findcn $curname)) 2)
  166. curscore = (at (pstat_score (findcn $curname)) 3)
  167. cursniper = (at (pstat_weap (findcn $curname)) 10)
  168. cursniperdmg = (at (pstat_weap (findcn $curname)) 11)
  169. cursmg = (at (pstat_weap (findcn $curname)) 8)
  170. cursmgdmg = (at (pstat_weap (findcn $curname)) 9)
  171. curar = (at (pstat_weap (findcn $curname)) 12)
  172. curardmg = (at (pstat_weap (findcn $curname)) 13)
  173. curshot = (at (pstat_weap (findcn $curname)) 6)
  174. curshotdmg = (at (pstat_weap (findcn $curname)) 7)
  175. curcarb = (at (pstat_weap (findcn $curname)) 4)
  176. curcarbdmg = (at (pstat_weap (findcn $curname)) 5)
  177. curusp = (at (pstat_weap (findcn $curname)) 2)
  178. curuspdmg = (at (pstat_weap (findcn $curname)) 3)
  179. curaki = (at (pstat_weap (findcn $curname)) 18)
  180. curakidmg = (at (pstat_weap (findcn $curname)) 19)
  181. curnade = (at (pstat_weap (findcn $curname)) 16)
  182. curnadedmg = (at (pstat_weap (findcn $curname)) 17)
  183. curknife = (at (pstat_weap (findcn $curname)) 0)
  184. curknifedmg = (at (pstat_weap (findcn $curname)) 1)
  185. curratio = (divf $curfrags $curdeaths) // Calculate ratio.
  186. if (&& (<= $minutesremaining 0) (= $strst 0)) [ // Add current scores to all-time totals during intermission.
  187. += atfrags $curfrags // Calculate all-time stats. // TODO: Make it possible to add to these for on-the-fly all-time stats viewing.
  188. += atdeaths $curdeaths
  189. += atscore $curscore
  190. += atflags $curflags
  191. += atratio $curratio
  192. += atftkst $ftkst // Frag teamkills.
  193. += athtkst $htkst // Headshot teamkills.
  194. += atstkst $stkst // Splatter teamkills.
  195. += atktkst $ktkst // Knife teamkills.
  196. += atgtkst $gtkst // Grenade teamkills.
  197. += attkst $tkst // Total teamkills.
  198. += atsniper $cursniper // # of shots per weapon...
  199. += atsmg $cursmg
  200. += atar $curar
  201. += atshot $curshot
  202. += atcarb $curcarb
  203. += atusp $curusp
  204. += ataki $curaki
  205. += atnade $curnade
  206. += atknife $curknife
  207. += atsniperdmg $cursniperdmg // Per weapon damage stats...
  208. += atsmgdmg $cursmgdmg
  209. += atardmg $curardmg
  210. += atshotdmg $curshotdmg
  211. += atcarbdmg $curcarbdmg
  212. += atuspdmg $curuspdmg
  213. += atakidmg $curakidmg
  214. += atnadedmg $curnadedmg
  215. += atknifedmg $curknifedmg
  216. += atcfst $cfst // CTF flags.
  217. += atdfst $dfst // Dropped flags.
  218. += athfst $hfst // Hunted flags.
  219. += atkfst $kfst // Kept flags.
  220. += atlfst $lfst // Lost flags.
  221. += atsfst $sfst // Stolen flags.
  222. += atgbst $gbst // Grenade gibs.
  223. += athsst $hsst // Headshots.
  224. += atknst $knst // Knife gibs.
  225. += atspst $spst // Splatters...
  226. += atsuicides $suicides // Suicides...
  227. += atscoped $scoped // Scopes...
  228. if (> $chksst $athksst) [ // Highest ever kill streak...
  229. athksst = $chksst
  230. ] []
  231. atscoreavg = (divf $curscore $games_played) // Average score.
  232. atratio = (divf $atfrags $atdeaths) // All-time and/or Average Ratio? FIXME...
  233. if (= (curmodeattr team) 1) [ // Check if user is in a team mode.
  234. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [
  235. if (= (curteam) 1) [ // If playing for RVSF, +1 to it's stat.
  236. += rvsfst 1
  237. ] [
  238. += clast 1 // Else they are playing for CLA, +1 to it's stat.
  239. ]] []] []
  240. 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.
  241. ] []
  242. if (= $gamemode 0) [ // If statements for holding the curmode acronym for the current round stats menu...
  243. modest = "TDM" // Store the acronym in alias "modest".
  244. // Only add to the mode/map counting stats if they are playing online or bot multiplayer...
  245. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += tdmst 1] []] []
  246. ] [
  247. if (= $gamemode 2) [
  248. modest = "DM"
  249. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += dmst 1; += ffast 1] []] []
  250. ] [
  251. if (= $gamemode 4) [
  252. modest = "TSURV"
  253. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += tsvst 1] []] []
  254. ] [
  255. if (= $gamemode 3) [
  256. modest = "SURV"
  257. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += svst 1; += ffast 1] []] []
  258. ] [
  259. if (= $gamemode 5) [
  260. modest = "CTF"
  261. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += ctfst 1] []] []
  262. ] [
  263. if (= $gamemode 13) [
  264. modest = "HTF"
  265. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += htfst 1] []] []
  266. ] [
  267. if (= $gamemode 15) [
  268. modest = "KTF"
  269. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += ktfst 1; += ffast 1] []] []
  270. ] [
  271. if (= $gamemode 14) [
  272. modest = "TKTF"
  273. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += tktfst 1] []] []
  274. ] [
  275. if (= $gamemode 6) [
  276. modest = "PF"
  277. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += pfst 1; += ffast 1] []] []
  278. ] [
  279. if (= $gamemode 9) [
  280. modest = "LSS"
  281. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += lssst 1; += ffast 1] []] []
  282. ] [
  283. if (= $gamemode 10) [
  284. modest = "OSOK"
  285. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += osokst 1; += ffast 1] []] []
  286. ] [
  287. if (= $gamemode 11) [
  288. modest = "TOSOK"
  289. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += tosokst 1] []] []
  290. ] [
  291. if (= $gamemode 7) [
  292. modest = "BTDM"
  293. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += btdmst 1; += botst 1] []] []
  294. ] [
  295. if (= $gamemode 8) [
  296. modest = "BDM"
  297. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += bdmst 1; += ffast 1; += botst 1] []] []
  298. ] [
  299. if (= $gamemode 12) [
  300. modest = "BOSOK"
  301. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += bosokst 1; += ffast 1; += botst 1] []] []
  302. ] [
  303. if (= $gamemode 1) [
  304. modest = "COOP"
  305. if (= $gmst 0) [if (|| (= $connected 1) (= (curmodeattr bot) 1)) [gmst = 1; += coopst 1] []] []
  306. ] []]]]]]]]]]]]]]]]
  307. if (= $mpst 0) [
  308. if (= (strcmp (curmap 1) ac_aqueous) 1) [
  309. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += aqueoussst 1; += offmpst 1] []
  310. ] [
  311. if (= (strcmp (curmap 1) ac_arabian) 1) [
  312. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += arabianst 1; += offmpst 1] []
  313. ] [
  314. if (= (strcmp (curmap 1) ac_arctic) 1) [
  315. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += arcticst 1; += offmpst 1] []
  316. ] [
  317. if (= (strcmp (curmap 1) ac_arid) 1) [
  318. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += aridst 1; += offmpst 1] []
  319. ] [
  320. if (= (strcmp (curmap 1) ac_complex) 1) [
  321. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += complexst 1; += offmpst 1] []
  322. ] [
  323. if (= (strcmp (curmap 1) ac_depot) 1) [
  324. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += depotst 1; += offmpst 1] []
  325. ] [
  326. if (= (strcmp (curmap 1) ac_desert) 1) [
  327. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += desertst 1; += offmpst 1] []
  328. ] [
  329. if (= (strcmp (curmap 1) ac_desert2) 1) [
  330. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += desert2st 1; += offmpst 1] []
  331. ] [
  332. if (= (strcmp (curmap 1) ac_desert3) 1) [
  333. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += desert3st 1; += offmpst 1] []
  334. ] [
  335. if (= (strcmp (curmap 1) ac_douze) 1) [
  336. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += douzest 1; += offmpst 1] []
  337. ] [
  338. if (= (strcmp (curmap 1) ac_elevation) 1) [
  339. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += elevationst 1; += offmpst 1] []
  340. ] [
  341. if (= (strcmp (curmap 1) ac_gothic) 1) [
  342. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += gothicst 1; += offmpst 1] []
  343. ] [
  344. if (= (strcmp (curmap 1) ac_iceroad) 1) [
  345. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += iceroadst 1; += offmpst 1] []
  346. ] [
  347. if (= (strcmp (curmap 1) ac_ingress) 1) [
  348. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += ingressst 1; += offmpst 1] []
  349. ] [
  350. if (= (strcmp (curmap 1) ac_keller) 1) [
  351. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += kellerst 1; += offmpst 1] []
  352. ] [
  353. if (= (strcmp (curmap 1) ac_mines) 1) [
  354. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += minesst 1; += offmpst 1] []
  355. ] [
  356. if (= (strcmp (curmap 1) ac_outpost) 1) [
  357. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += outpostst 1; += offmpst 1] []
  358. ] [
  359. if (= (strcmp (curmap 1) ac_power) 1) [
  360. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += powerst 1; += offmpst 1] []
  361. ] [
  362. if (= (strcmp (curmap 1) ac_rattrap) 1) [
  363. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += rattrapst 1; += offmpst 1] []
  364. ] [
  365. if (= (strcmp (curmap 1) ac_scaffold) 1) [
  366. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += scaffoldst 1; += offmpst 1] []
  367. ] [
  368. if (= (strcmp (curmap 1) ac_shine) 1) [
  369. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += shinest 1; += offmpst 1] []
  370. ] [
  371. if (= (strcmp (curmap 1) ac_snow) 1) [
  372. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += snowst 1; += offmpst 1] []
  373. ] [
  374. if (= (strcmp (curmap 1) ac_sunset) 1) [
  375. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += sunsetst 1; += offmpst 1] []
  376. ] [
  377. if (= (strcmp (curmap 1) ac_toxic) 1) [
  378. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += toxicst 1; += offmpst 1] []
  379. ] [
  380. if (= (strcmp (curmap 1) ac_urban) 1) [
  381. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += urbanst 1; += offmpst 1] []
  382. ] [
  383. if (= (strcmp (curmap 1) ac_werk) 1) [
  384. if (|| (= $connected 1) (= (curmodeattr bot) 1)) [mpst = 1; += werkst 1; += offmpst 1] []
  385. ] [+= cstmpst 1; mpst = 1]]]]]]]]]]]]]]]]]]]]]]]]]]] []
  386. ]
  387.  
  388. clrst = [ // Function used to clear temporary stats holding and script flow aliases on every map start.
  389. strst = 0
  390. hsst = 0
  391. knst = 0
  392. spst = 0
  393. gbst = 0
  394. cfst = 0
  395. dfst = 0
  396. lfst = 0
  397. kfst = 0
  398. sfst = 0
  399. tkst = 0
  400. htkst = 0
  401. ktkst = 0
  402. ftkst = 0
  403. gtkst = 0
  404. stkst = 0
  405. suicides = 0
  406. scoped = 0
  407. gmst = 0
  408. mpst = 0
  409. cksst = 0
  410. chksst = 0
  411. // cvflag = 0
  412. // dfflag = 0
  413. // suicides = 0
  414. // combo = 0
  415. // mcombo = 0
  416. ]
  417.  
  418. clrats = [ // Function used to clear all-time statistics "on-the-fly" via user input.
  419. if (= $arg1 1) [
  420. atcfst = 0
  421. atdfst = 0
  422. athfst = 0
  423. atkfst = 0
  424. atlfst = 0
  425. atsfst = 0
  426. atfrags = 0
  427. atdeaths = 0
  428. atsuicides = 0
  429. atscore = 0
  430. atratio = 0
  431. atgbst = 0
  432. athsst = 0
  433. atknst = 0
  434. atspst = 0
  435. atftkst = 0
  436. athtkst = 0
  437. atstkst = 0
  438. atktkst = 0
  439. atgtkst = 0
  440. attkst = 0
  441. atsniper = 0
  442. atsniperdmg = 0
  443. atsmg = 0
  444. atsmgdmg = 0
  445. atar = 0
  446. atardmg = 0
  447. atshot = 0
  448. atshotdmg = 0
  449. atcarb = 0
  450. atcarbdmg = 0
  451. atusp = 0
  452. atuspdmg = 0
  453. ataki = 0
  454. atakidmg = 0
  455. atnade = 0
  456. atnadedmg = 0
  457. atknife = 0
  458. atknifedmg = 0
  459. acstart = 0
  460. atscoped = 0
  461. tdmst = 0
  462. dmst = 0
  463. tsvst = 0
  464. svst = 0
  465. ctfst = 0
  466. htfst = 0
  467. ktfst = 0
  468. tktfst = 0
  469. pfst = 0
  470. lssst = 0
  471. osokst = 0
  472. tosokst = 0
  473. btdmst = 0
  474. bdmst = 0
  475. bosokst = 0
  476. coopst = 0
  477. aqueousst = 0
  478. arabianst = 0
  479. arcticst = 0
  480. aridst = 0
  481. complexst = 0
  482. depotst = 0
  483. desertst = 0
  484. desert2st = 0
  485. desert3st = 0
  486. douzest = 0
  487. // edificest = 0
  488. elevationst = 0
  489. gothicst = 0
  490. iceroadst = 0
  491. // industrialst = 0
  492. ingressst = 0
  493. kellerst = 0
  494. minesst = 0
  495. outpostst = 0
  496. powerst = 0
  497. rattrapst = 0
  498. scaffoldst = 0
  499. shinest = 0
  500. snowst = 0
  501. sunsetst = 0
  502. toxicst = 0
  503. urbanst = 0
  504. werkst = 0
  505. rvsfst = 0
  506. clast = 0
  507. cstmpst = 0
  508. offmpst = 0
  509. athksst = 0
  510. ffast = 0
  511. botst = 0
  512. ] []
  513. ]
  514.  
  515. stratvalues = [ // Function used for storing current round statistics to the all-time statistics if a proper
  516. // intermission was not given (i.e. admin forces new map) before clearing stats for the next
  517. // round.
  518. if (= $arg1 1) [
  519. += atfrags $curfrags // Calculate all-time stats. // TODO: Make it possible to add to these for on-the-fly all-time stats viewing.
  520. += atdeaths $curdeaths
  521. += atscore $curscore
  522. += atflags $curflags
  523. += atratio $curratio
  524. += atftkst $ftkst // Frag teamkills.
  525. += athtkst $htkst // Headshot teamkills.
  526. += atstkst $stkst // Splatter teamkills.
  527. += atktkst $ktkst // Knife teamkills.
  528. += atgtkst $gtkst // Grenade teamkills.
  529. += attkst $tkst // Total teamkills.
  530. += atsniper $cursniper // # of shots per weapon...
  531. += atsmg $cursmg
  532. += atar $curar
  533. += atshot $curshot
  534. += atcarb $curcarb
  535. += atusp $curusp
  536. += ataki $curaki
  537. += atnade $curnade
  538. += atknife $curknife
  539. += atsniperdmg $cursniperdmg // Per weapon damage stats...
  540. += atsmgdmg $cursmgdmg
  541. += atardmg $curardmg
  542. += atshotdmg $curshotdmg
  543. += atcarbdmg $curcarbdmg
  544. += atuspdmg $curuspdmg
  545. += atakidmg $curakidmg
  546. += atnadedmg $curnadedmg
  547. += atknifedmg $curknifedmg
  548. += atcfst $cfst // CTF flags.
  549. += atdfst $dfst // Dropped flags.
  550. += athfst $hfst // Hunted flags.
  551. += atkfst $kfst // Kept flags.
  552. += atlfst $lfst // Lost flags.
  553. += atsfst $sfst // Stolen flags.
  554. += atgbst $gbst // Grenade gibs.
  555. += athsst $hsst // Headshots.
  556. += atknst $knst // Knife gibs.
  557. += atspst $spst // Splatters...
  558. += atsuicides $suicides // Suicides...
  559. += atscoped $scoped // Scopes...
  560. if (> $chksst $athksst) [ // Highest ever kill streak...
  561. athksst = $chksst
  562. ] []
  563. atscoreavg = (divf $curscore $games_played) // Average score.
  564. atratio = (divf $atfrags $atdeaths) // All-time and/or Average Ratio? FIXME...
  565. ] []
  566. ]
  567.  
  568. stats = [
  569. calc // Gather and calculate the stats.
  570. ocsize = $consize
  571. consize 100
  572. if (strcmp $arg1 "all") [ // If user entered "all" as the first argument display the all-time stats instead.
  573. echo ""
  574. echo All-Time Frags: $atfrags
  575. echo All-Time Deaths: $atdeaths
  576. echo All-Time Score: $atscore
  577. if (< $atdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
  578. echo All-Time Ratio: (concatword $atfrags .0)
  579. ] [
  580. echo All-Time Ratio: $atratio
  581. ]
  582. echo CLA: $clast
  583. echo RVSF: $rvsfst
  584. ] [ // Else show user the current round stats.
  585. consize 24
  586. echo ""
  587. echo Flags: $curflags
  588. echo Frags: $curfrags
  589. echo Deaths: $curdeaths
  590. if (= $connected 1) [ // Score is only calculated in multiplayer.
  591. echo Score: $curscore
  592. ] [
  593. echo Score: N/A
  594. ]
  595. if (< $curdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
  596. echo Ratio: (concatword $curfrags .0)
  597. ] [
  598. echo Ratio: $curratio
  599. ]
  600. echo FTK's: $ftkst
  601. echo HTK's: $htkst
  602. echo STK's: $htkst
  603. echo KTK's: $ktkst
  604. echo GTK's: $gtkst
  605. echo Total TK's: $tkst
  606. echo ""
  607. if (= $connected 1) [ // Weapon damage is only shown in multiplayer, for some reason. :(
  608. echo Sniper: (concatword $cursniper / $cursniperdmg)
  609. echo SMG: (concatword $cursmg / $cursmgdmg)
  610. echo AR: (concatword $curar / $curardmg)
  611. echo Shotgun: (concatword $curshot / $curshotdmg)
  612. echo Carbine: (concatword $curcarb / $curcarbdmg)
  613. echo Pistol: (concatword $curusp / $curuspdmg)
  614. echo Akimbo: (concatword $curaki / $curakidmg)
  615. echo Grenade: (concatword $curnade / $curnadedmg)
  616. echo Knife: (concatword $curknife / $curknifedmg)
  617. echo ""
  618. echo Weapon stats are currently shots/damage.
  619. ] [
  620. echo Sniper: $cursniper
  621. echo SMG: $cursmg
  622. echo AR: $curar
  623. echo Shotgun: $curshot
  624. echo Carbine: $curcarb
  625. echo Pistol: $curusp
  626. echo Akimbo: $curaki
  627. echo Grenade: $curnade
  628. echo Knife: $curknife
  629. echo ""
  630. echo Weapon stats for SP are currently # of shots fired.
  631. sleep 1000 [consize $ocsize]
  632. ]]]
  633.  
  634. get_stats = [ // Function used for gathering stats that pstat_score cannot access.
  635. // Loops every millisecond and scans the contents of the last line
  636. // on the console for various events. Therefore, some of the stats
  637. // collected via this method (the only method ATM) may not be 100%
  638. // accurate. For instance, double grenade gibs will only count 1,
  639. // because the events are happening simultaneously and CubeScript
  640. // currently cannot loop itself quickly enough for it to catch both
  641. // instances. For this exact same reason, we are unable to count your
  642. // flag covers, defences, combos, multi combos, etc. while you are
  643. // using /hudextras... Another project for the devs maybe? :P *hint*
  644.  
  645. if (= (strstr $conline " 3you fragged teammate") 1) [ // Frags on enemies.
  646. += tkst 1; += ftkst 1; conline [ ] // +1 to the total teamkill count, and the "frag teamkill" count.
  647. // Clear conline immediately after adding to the stats.
  648. ] [
  649. if (= (strstr $conline " 3you headshotted teammate") 1) [ // Headshots on enemies.
  650. += tkst 1; += htkst 1; conline [ ]
  651. ] [
  652. if (= (strstr $conline " 3you splattered teammate") 1) [ // Splatters on enemies.
  653. += tkst 1; += stkst 1; conline [ ]
  654. ] [
  655. if (= (strstr $conline " 3you knifed teammate") 1) [ // Knife gibs on enemies.
  656. += tkst 1; += ktkst 1; conline [ ]
  657. ] [
  658. if (= (strstr $conline " 3you gibbed teammate") 1) [ // Grenade gibs on enemies.
  659. += tkst 1; += gtkst 1; conline [ ]
  660. ] [
  661. if (&& (= (strstr $conline "you fragged") 1) (= (strstr $conline " 3teammate") 0)) [ // Used for kill streaks...
  662. += cksst 1; conline [ ]
  663. ] [
  664. if (&& (= (strstr $conline "you headshotted") 1) (= (strstr $conline " 3teammate") 0)) [ // Headshot TK's
  665. += hsst 1; += cksst 1; conline [ ]
  666. ] [
  667. if (&& (= (strstr $conline "you knifed") 1) (= (strstr $conline " 3teammate") 0)) [ // Knife Gib TK's
  668. += knst 1; += cksst 1; conline [ ]
  669. ] [
  670. if (&& (= (strstr $conline "you splattered") 1) (= (strstr $conline " 3teammate") 0)) [ // Splatter TK's
  671. += spst 1; += cksst 1; conline [ ]
  672. ] [
  673. if (&& (= (strstr $conline "you gibbed") 1) (= (strstr $conline " 3teammate") 0)) [ // Grenade Gib TK's
  674. += gbst 1; += cksst 1; conline [ ]
  675. ] [
  676. if (&& (= (strcmp (at $conline 0) " 2you") 1) (= (strstr $conline "got fragged by") 1)) [ // Used to reset kill streaks...
  677. cksst = 0; conline [ ]
  678. ] [
  679. if (&& (= (strcmp (at $conline 0) " 2you") 1) (= (strstr $conline "got headshotted by") 1)) [
  680. cksst = 0; conline [ ]
  681. ] [
  682. if (&& (= (strcmp (at $conline 0) " 2you") 1) (= (strstr $conline "got knifed by") 1)) [
  683. cksst = 0; conline [ ]
  684. ] [
  685. if (&& (= (strcmp (at $conline 0) " 2you") 1) (= (strstr $conline "got splattered by") 1)) [
  686. cksst = 0; conline [ ]
  687. ] [
  688. if (&& (= (strcmp (at $conline 0) " 2you") 1) (= (strstr $conline "got gibbed by") 1)) [
  689. cksst = 0; conline [ ]
  690. ] [
  691. if (= (strcmp $conline " 2you got the enemy flag") 1) [ // Stolen flags.
  692. += sfst 1; conline [ ]
  693. ] [
  694. if (= (strcmp $conline " 2you got the flag") 1) [
  695. += sfst 1; conline [ ]
  696. ] [
  697. if (= (strcmp $conline " 2you dropped the flag") 1) [ // Dropped flags.
  698. += dfst 1; conline [ ]
  699. ] [
  700. if (= (strcmp $conline " 2you lost the flag") 1) [ // Lost flags.
  701. += lfst 1; conline [ ]
  702. ] [
  703. if (= (strstr $conline " 2you have kept the flag for") 1) [ // TKTF/KTF Flags
  704. += kfst 1; conline [ ]
  705. ][
  706. if (&& (= $gamemode 5) (= (strcmp $conline " 2you scored") 1)) [ // CTF Flags
  707. += cfst 1; conline [ ]
  708. ] [
  709. if (&& (= $gamemode 13) (= (strcmp $conline " 2you scored") 1)) [ // HTF Flags
  710. += hfst 1; conline [ ]
  711. ] [
  712. if (= (strcmp $conline " 2you suicided!") 1) [ // Suicides...
  713. += suicides 1; cksst = 0; conline [ ]
  714. ] [
  715. ]]]]]]]]]]]]]]]]]]]]]]]
  716. if (> $cksst $chksst) [
  717. chksst = $cksst
  718. ] []
  719. sleep 1 [get_stats] // The loop...
  720. ]
  721.  
  722. if (strstr $mapstartalways clrst) [] [ // Automate stuff :)
  723. add2alias mapstartalways [consize $ocsize; sleep 5 [if (= $strst 0) [stratvalues 1] []]; sleep 10 [clrst]; sleep 15 [get_stats]]
  724. add2alias start_intermission [stats]
  725. ]
  726.  
  727. // A menu seemed like it would be the easiest and most asthetically pleasing method of displaying the stats...IDK
  728. newmenu "Current Round Statistics" // Current Round Stats Menu
  729. menuinit [(calc)]
  730. menuitemvar [concat (c 4)Here are your stats for $modest (concatword (curmap 1) :)]
  731. menuitem "" -1
  732. menuitemvar [concat (c 0) " ~Flags~"]
  733. menuitemtextinput " 2Scored: " "result $cfst" // CTF Flags
  734. //menuitemtextinput " 2Covered: " "result $cvflag"
  735. //menuitemtextinput " 2Defended: " "result $dfflag"
  736. menuitemtextinput " 2Dropped: " "result $dfst"
  737. menuitemtextinput " 2Hunted: " "result $hfst" // HTF Flags
  738. menuitemtextinput " 2Kept: " "result $kfst" // TKTF/KTF Flags
  739. menuitemtextinput " 3Lost: " "result $lfst"
  740. menuitemtextinput " 2Stolen: " "result $sfst" // # of times carrying flag.
  741. menuitem "" -1
  742. menuitemvar [concat (c 3) " ~Kills~" ]
  743. menuitemtextinput " 2Frags: " "result $curfrags"
  744. menuitemtextinput " 3Deaths: " "result $curdeaths"
  745. menuitemtextinput " 3Suicides: " "result $suicides"
  746. menuitemtextinput " 2Score: " "result $curscore"
  747. //menuitemtextinput " 2Combos: " "result $combo"
  748. //menuitemtextinput " 2Multi-Combos: " "result $mcombo"
  749. menuitemtextinput " 2Ratio: " "result $curratio"
  750. menuitemtextinput " 2Gibs: " "result $gbst"
  751. menuitemtextinput " 2Headshots: " "result $hsst"
  752. menuitemtextinput " 2Knife Gibs: " "result $knst"
  753. menuitemtextinput " 2Splatters: " "result $spst"
  754. menuitemtextinput " 2Current KS: " "result $cksst"
  755. menuitemtextinput " 2Highest KS: " "result $chksst"
  756. menuitemtextinput " 3FTK's: " "result $ftkst"
  757. menuitemtextinput " 3HTK's: " "result $htkst"
  758. menuitemtextinput " 3STK's: " "result $stkst"
  759. menuitemtextinput " 3KTK's: " "result $ktkst"
  760. menuitemtextinput " 3GTK's: " "result $gtkst"
  761. menuitemtextinput " 7Total TK's: " "result $tkst"
  762. menuitem "" -1
  763. menuitemvar [concat (c 1) " ~Weapons~" ]
  764. menuitemtextinput " 2Sniper: " [(concatword $cursniper / $cursniperdmg)]
  765. menuitemtextinput " 2SMG: " [(concatword $cursmg / $cursmgdmg)]
  766. menuitemtextinput " 2AR: " [(concatword $curar / $curardmg)]
  767. menuitemtextinput " 2Shotgun: " [(concatword $curshot / $curshotdmg)]
  768. menuitemtextinput " 2Carbine: " [(concatword $curcarb / $curcarbdmg)]
  769. menuitemtextinput " 2Pistol: " [(concatword $curusp / $curuspdmg)]
  770. menuitemtextinput " 2Akimbo: " [(concatword $curaki / $curakidmg)]
  771. menuitemtextinput " 2Grenade: " [(concatword $curnade / $curnadedmg)]
  772. menuitemtextinput " 2Knife: " [(concatword $curknife / $curknifedmg)]
  773. menuitemtextinput " 2Scopes: " "result $scoped"
  774. menuitem "" -1
  775. menuitemvar [concat (c 4)Weapon stats are currently shots/damage.]
  776.  
  777. newmenu "All-Time Statistics" // All-Time Stats Menu
  778. menuinit [(calc)]
  779. menuitemvar [concat (c 4)Here are your all-time statistics:]
  780. menuitem "" -1
  781. menuitemvar [concat (c 0) " ~Flags~"]
  782. menuitemtextinput " 2Scored: " "result $atcfst" // CTF Flags
  783. //menuitemtextinput " 2Covered: " "result $atcvflag"
  784. //menuitemtextinput " 2Defended: " "result $atdfflag"
  785. menuitemtextinput " 2Dropped: " "result $atdfst"
  786. menuitemtextinput " 2Hunted: " "result $athfst" // HTF Flags
  787. menuitemtextinput " 2Kept: " "result $atkfst" // TKTF/KTF Flags
  788. menuitemtextinput " 3Lost: " "result $atlfst"
  789. menuitemtextinput " 2Stolen: " "result $atsfst" // # of times carrying flag.
  790. menuitem "" -1
  791. menuitemvar [concat (c 3) " ~Kills~" ]
  792. menuitemtextinput " 2Frags: " "result $atfrags"
  793. menuitemtextinput " 3Deaths: " "result $atdeaths"
  794. menuitemtextinput " 3Suicides: " "result $atsuicides"
  795. menuitemtextinput " 2Score: " "result $atscore"
  796. //menuitemtextinput " 2Combos: " "result $atcombo"
  797. //menuitemtextinput " 2Multi-Combos: " "result $atmcombo"
  798. menuitemtextinput " 2Ratio: " "result $atratio"
  799. menuitemtextinput " 2Gibs: " "result $atgbst"
  800. menuitemtextinput " 2Headshots: " "result $athsst"
  801. menuitemtextinput " 2Knife Gibs: " "result $atknst"
  802. menuitemtextinput " 2Splatters: " "result $atspst"
  803. menuitemtextinput " 2Highest KS: " "result $athksst"
  804. menuitemtextinput " 3FTK's: " "result $atftkst"
  805. menuitemtextinput " 3HTK's: " "result $athtkst"
  806. menuitemtextinput " 3STK's: " "result $atstkst"
  807. menuitemtextinput " 3KTK's: " "result $atktkst"
  808. menuitemtextinput " 3GTK's: " "result $atgtkst"
  809. menuitemtextinput " 7Total TK's: " "result $attkst"
  810. menuitem "" -1
  811. menuitemvar [concat (c 1) " ~Weapons~" ]
  812. menuitemtextinput " 2Sniper: " [(concatword $atsniper / $atsniperdmg)]
  813. menuitemtextinput " 2SMG: " [(concatword $atsmg / $atsmgdmg)]
  814. menuitemtextinput " 2AR: " [(concatword $atar / $atardmg)]
  815. menuitemtextinput " 2Shotgun: " [(concatword $atshot / $atshotdmg)]
  816. menuitemtextinput " 2Carbine: " [(concatword $atcarb / $atcarbdmg)]
  817. menuitemtextinput " 2Pistol: " [(concatword $atusp / $atuspdmg)]
  818. menuitemtextinput " 2Akimbo: " [(concatword $ataki / $atakidmg)]
  819. menuitemtextinput " 2Grenade: " [(concatword $atnade / $atnadedmg)]
  820. menuitemtextinput " 2Knife: " [(concatword $atknife / $atknifedmg)]
  821. menuitemtextinput " 2Scopes: " "result $atscoped"
  822. menuitem "" -1
  823. menuitemvar [concat (c 4)Weapon stats are currently shots/damage.]
  824. menuitem "" -1
  825. menuitemvar [concat (c 6) " ~Modes~" ]
  826. menuitemtextinput " 2TDM: " "result $tdmst"
  827. menuitemtextinput " 2DM: " "result $dmst"
  828. menuitemtextinput " 2TSURV: " "result $tsvst"
  829. menuitemtextinput " 2SURV: " "result $svst"
  830. menuitemtextinput " 2CTF: " "result $ctfst"
  831. menuitemtextinput " 2HTF: " "result $htfst"
  832. menuitemtextinput " 2TKTF: " "result $tktfst"
  833. menuitemtextinput " 2KTF: " "result $ktfst"
  834. menuitemtextinput " 2PF: " "result $pfst"
  835. menuitemtextinput " 2LSS: " "result $lssst"
  836. menuitemtextinput " 2TOSOK: " "result $tosokst"
  837. menuitemtextinput " 2OSOK: " "result $osokst"
  838. menuitemtextinput " 2BTDM: " "result $btdmst"
  839. menuitemtextinput " 2BDM: " "result $bdmst"
  840. menuitemtextinput " 2BOSOK: " "result $bosokst"
  841. menuitemtextinput " 2COOP: " "result $coopst"
  842. menuitem "" -1
  843. menuitemvar [concat (c 7) " ~Maps~" ]
  844. menuitemtextinput " 2ac_aqueous: " "result $aqueousst"
  845. menuitemtextinput " 2ac_arabian: " "result $arabianst"
  846. menuitemtextinput " 2ac_arctic: " "result $arcticst"
  847. menuitemtextinput " 2ac_arid: " "result $aridst"
  848. menuitemtextinput " 2ac_complex: " "result $complexst"
  849. menuitemtextinput " 2ac_depot: " "result $depotst"
  850. menuitemtextinput " 2ac_desert: " "result $desertst"
  851. menuitemtextinput " 2ac_desert2: " "result $desert2st"
  852. menuitemtextinput " 2ac_desert3: " "result $desert3st"
  853. menuitemtextinput " 2ac_douze: " "result $douzest"
  854. //menuitemtextinput " 2ac_edifice: " "result $edificest"
  855. menuitemtextinput " 2ac_elevation: " "result $elevationst"
  856. menuitemtextinput " 2ac_gothic: " "result $gothicst"
  857. menuitemtextinput " 2ac_iceroad: " "result $iceroadst"
  858. //menuitemtextinput " 2ac_industrial: " "result $industrialst"
  859. menuitemtextinput " 2ac_ingress: " "result $ingressst"
  860. menuitemtextinput " 2ac_keller: " "result $kellerst"
  861. menuitemtextinput " 2ac_mines: " "result $minesst"
  862. menuitemtextinput " 2ac_outpost: " "result $outpostst"
  863. menuitemtextinput " 2ac_power: " "result $powerst"
  864. menuitemtextinput " 2ac_rattrap: " "result $rattrapst"
  865. menuitemtextinput " 2ac_scaffold: " "result $scaffoldst"
  866. menuitemtextinput " 2ac_shine: " "result $shinest"
  867. menuitemtextinput " 2ac_snow: " "result $snowst"
  868. menuitemtextinput " 2ac_sunset: " "result $sunsetst"
  869. menuitemtextinput " 2ac_toxic: " "result $toxicst"
  870. menuitemtextinput " 2ac_urban: " "result $urbanst"
  871. menuitemtextinput " 2ac_werk: " "result $werkst"
  872. menuitemtextinput " 2Official: " "result $offmpst"
  873. menuitemtextinput " 2Custom: " "result $cstmpst"
  874. menuitem "" -1
  875. menuitemvar [concat (c 0) " ~Other~" ]
  876. menuitemtextinput " 2AC Starts: " "result $acstart"
  877. menuitemtextinput " 3CLA: " "result $clast"
  878. menuitemtextinput " 1RVSF: " "result $rvsfst"
  879. menuitemtextinput " 4FFA: " "result $ffast"
  880. menuitemtextinput " 2Bot: " "result $botst"
  881.  
  882. showcurstatsbind = [ // Pre-built current round stats menu viewing alias for easy key binding...
  883. // Acts as a "toggle" bind similar to viewing the scoreboard. Press
  884. // and hold to view, release to close.
  885. calc // For accuracy purposes calculate updated statistics before showing the menu.
  886. showmenu "Current Round Statistics"
  887. onrelease [closemenu "Current Round Statistics"]
  888. ]
  889.  
  890. showatstatsbind = [ // Pre-built all-time stats menu viewing alias for easy key binding...
  891. // Acts as a "toggle" bind similar to viewing the scoreboard. Press
  892. // and hold to view, release to close.
  893. calc // For accuracy purposes calculate updated statistics before showing the menu.
  894. showmenu "All-Time Statistics"
  895. onrelease [closemenu "All-Time Statistics"]
  896. ]
  897.  
  898. statsmenu = [ // Command for showing the menus, IDK why people would not want to use the binds. :P
  899. if (strcmp $arg1 "all") [
  900. showmenu "All-Time Statistics"
  901. ] [
  902. showmenu "Current Round Statistics"
  903. ]
  904. ]
  905.  
  906. bind BACKQUOTE [showcurstatsbind]
  907. bind EQUALS [showatstatsbind]
  908.  
  909. docsection [MPL] // In-game documentation of the script's various commands.
  910.  
  911. docident [clrst] [MPL: Clears the current round stats.]
  912. docexample [/clrst] []
  913.  
  914. docident [clrats] [MPL: Clears the all-time stats.]
  915. docargument [A] [Clears the values only if this is set to 1.]
  916. docexample [/clrats 1] []
  917.  
  918. docident [stats] [MPL: Prints your current round stats to the console.]
  919. docargument [A] [Prints your all time stats to the console if this is set to "all".]
  920. docexample [/stats] [Prints your current round stats.]
  921. docexample [/stats all] [Prints your all-time stats.]
  922.  
  923. docident [statsmenu] [MPL: Shows your current round stats menu.]
  924. docargument [A] [Shows your all-time stats menu if this is set to "all".]
  925. docexample [/statsmenu] [Shows your current round stats menu.]
  926. docexample [/statsmenu all] [Shows your all-time stats menu.]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement