This neat script keeps track of a bunch of statistics and puts them into a table. There is a little setup involved in getting this script working for the first time.


;Aardstats.tf by Vitae
;type /stats to view.
;create file named savevars.tf and input this (without the ;'s):
;/set level_count=0
;/set kills_count=0
;/set quests_count=0
;/set Stack_Count=0
;/set avgqp_count=0
;/set qp_count=0
;/set avgexp_count=0
;/set exp_count=0
;/set cps_count=0
;/set cpmobs_count=0
;/set cpqp_count=0
;you do not need to modify savevars.tf after that.  File will be written
;to automatically.
;Only modification you might need to make is if you do not use aardhotel for
;your quests.  Change 'administrator' to your questor's name be it clan 
;questor or Questor himself.

/def savevar = /listvar *_count %| /writefile savevars.tf
/set kills=0
/set exp=0
/set avgexp=0
/set avgqp=0
/set quests=0
/set qp=0
/set cps=0
/set cpmobs=0
/set cpqp=0

/def -mregexp -t'You receive ([0-9]+) experience points.' exp_1=/set kills=$[{kills}+1]%;/set exp=$[{exp}+{P1}]%;/set avgexp=$[exp/kills]%;/set exp_count=$[{exp_count}+{P1}]%;/set kills_count=$[{kills_count}+1]%;/set avgexp_count=$[exp_count/kills_count]%;/savevar
/def -mregexp -t'You receive ([0-9]+) bonus experience points (.*)' exp_2=/set exp=$[{exp}+{P1}]%;/set avgexp=$[exp/kills]%;/set exp_count=$[{exp_count}+{P1}]%;/set avgexp_count=$[exp_count/kills_count]%;/savevar

/def -mregexp -t'^The administrator tells you \'As a reward, I am giving you ([0-9]+) quest points and ([0-9]+) gold' reward1 =/set quests=$[{quests}+1]%;/set qp=$[{qp}+{P1}+2]%;/set quests_count=$[{quests_count}+1]%;/set avgqp=$[qp/quests]%;/set qp_count=$[{qp_count}+{P1}+2]%;/set avgqp_count=$[qp_count/quests_count]%;/savevar
/def -mregexp -t'^The gods reward you ([0-9]+) bonus quest points' reward3 =/set qp=$[{qp}+{P1}]%;/set avgqp=$[qp/quests]%;/set qp_count=$[{qp_count}+{P1}]%;/set avgqp_count=$[qp_count/quests_count]%;/savevar
/def -mregexp -t'^You gain an extra ([0-9]+) quest point(.*) luck bonus.' reward4=/set qp=$[{qp}+{P1}]%;/set avgqp=$[qp/quests]%;/set qp_count=$[{qp_count}+{P1}]%;/set avgqp_count=$[qp_count/quests_count]%;/savevar
/def -mregexp -t'^You get lucky and gain an extra ([0-9]+) quest points(.*).' reward5=/set qp=$[{qp}+{P1}]%;/set avgqp=$[qp/quests]%;/set qp_count=$[{qp_count}+{P1}]%;/set avgqp_count=$[qp_count/quests_count]%;/savevar

/def -mregexp -t'CONGRATULATIONS! You have completed your campaign.' campaigns=/set cps=$[{cps}+1]%;/set cps_count=$[{cps_count}+1]%;/savevar
/def -mregexp -t'^(.*)Reward of ([0-9]+) quest points added.' reward6=/set cpqp=$[{cpqp}+{P2}]%;/set cpqp_count=$[{cpqp_count}+{P2}]%;/savevar
/def -mregexp -t'Congratulations, that was one of your CAMPAIGN mobs!' campaign_mobs=/set cpmobs=$[{cpmobs}+1]%;/set cpmobs_count=$[{cpmobs_count}+1]%;/savevar


/def stats = \
  /test echo(pad("",15,"Since",10,"",5,"Since",10))%;\
  /test echo(pad("",15,"Restart",10,"",5,"Added",10))%;\
  /test echo(pad("",15,"------",10,"",5,"-----",10))%;\
  /test echo(pad("Exp",15,exp,10,"",5,exp_count,10))%;\
  /test echo(pad("Kills",15,kills,10,"",5,kills_count,10))%;\
  /test echo(pad("Avg Exp",15,avgexp,10,"",5,avgexp_count,10))%;\
  /test echo(pad("Total Quests",15,quests,10,"",5,quests_count,10))%;\
  /test echo(pad("QPs",15,qp,10,"",5,qp_count,10))%;\
  /test echo(pad("Avg QP's",15,avgqp,10,"",5,avgqp_count,10))%;\
  /test echo(pad("Campaigns",15,cps,10,"",5,cps_count,10))%;\
  /test echo(pad("CP Mobs",15,cpmobs,10,"",5,cpmobs_count,10))%;\
  /test echo(pad("CP QP's",15,cpqp,10,"",5,cpqp_count,10))

/load savevars.tf