Advertisement
Guest User

Untitled

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