Advertisement
Guest User

Untitled

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