Zmud Run Stats Counter

From AvatarWiki
Revision as of 05:21, 11 May 2007 by Llanor (talk | contribs) (And now it includes loss from recalling.)
Jump to navigation Jump to search

This trigger counts the number of kills, amount of experience you have gained (or lost) and the amount of levels gained on a run and shows it to the group. It also counts bashes, trips, throws and rescues, succesful or not.

Code

Copy each line individually and then paste them into zMud [1]:

#TRIGGER {^You receive (%d) experience points.} {#ad exp %1;#ad cnt 1} {runcounter}
#TRIGGER {^You attempt to bash} {#ad bash 1;stand} {runcounter}
#TRIGGER {^You bash into (%*) goes down!} {#ad bash 1;#ad sucbash 1} {runcounter}
#TRIGGER {^You throw (%*) to the ground!} {#ad throw 1;#ad sucthrow 1;#hi} {runcounter}
#TRIGGER {^You trip (%*) goes down!} {#ad trip 1;#ad suctrip 1} {runcounter}
#TRIGGER {^You try to grab a hold, but miss!} {#ad throw 1} {runcounter}
#TRIGGER {^You successfully rescue} {#ad rescue 1;#ad sucrescue 1} {runcounter}
#TRIGGER {^You sweep, but they are just a little too quick for you.} {#ad trip 1} {runcounter}
#TRIGGER {^You fail to rescue} {#ad rescue 1} {runcounter}
#TRIGGER {^You successfully rescue} {#ad rescue 1;#ad sucrescue 1} {runcounter}
#TRIGGER {^Death sucks (%*) experience points from you as payment for resurrection.} {#ad death 1;#ad dloss %1;#ad exp -%1} {runcounter}
#TRIGGER {^You flee (%*)! What a COWARD! You lose (%d) exps!} {#ad netxp -%2;#ad fleexp %2} {runcounter}
#TRIGGER {^You couldn't get away!  You lose (%d) exps.} {#ad netxp -%1;#ad fleexp %1} {runcounter}
#TRIGGER {^You recall from combat!  You lose (%d) exps.} {#ad netxp -%1;#ad fleexp %1} {runcounter}
#TRIGGER {^You failed!  You lose (%d) exps.} {#ad netxp -%1;#ad fleexp %1} {runcounter}
#TRIGGER {You are (%*) and a worshipper of (%x).} {#var worship %2} {runcounter}
#TRIGGER {Your gain is: (%d)/(%d) hp, (%d)/(%d) m, (%d)/(%d) mv (%d)/(%d) prac.} {#ad lev 1;emote increases in power!!  |by|%1 |y|hps|n|, |br|%3 |r|mana|n|, |bw|%7 |w|practices|n|.} {runcounter}
#VAR worship {Snikt}
#ALIAS runreport {get_color;gtell |bk|This run, |@bclr|@worship |bk|gave me: |@bclr|@exp |bk|xp, |@bclr|@cnt |bk|kills, |@bclr|@lev |bk|level(s).;#if {@death=0 && @fleexp=0} {} {gtell |bk|I've lost %if( @death!=0, ~|@bclr~|@deathloss ~|bk~|xp ~|bk~|by ~|@bclr~|@death ~|bk~|death~(s~))%if( @death!=0 and @fleexp!=0, ~|bk~| ~and ~|bk~|)%if( @fleexp!=0, ~|@bclr~|@fleexp ~|bk~|xp from fleeing) so my net gain is |@bclr|@netxp|bk| xp.};stats}
#ALIAS stats {#if {@bash=0 && @trip=0 && @throw=0 && @rescue=0} {} {gtell %if( @bash!=0, ~|bk~| Bashes: ~|@bclr~|@sucbash~|@bclr~|~/~|@bclr~|@bash)%if( @trip!=0, ~|bk~| Trips: ~|@bclr~|@suctrip~|bk~|~/~|@bclr~|@trip)%if( @throw!=0, ~|bk~| Throws: ~|@bclr~|@sucthrow~|bk~|~/~|@bclr~|@throw)%if( @rescue!=0, ~|bk~| Rescues: ~|@bclr~|@sucrescue~|bk~|~/~|@bclr~|@rescue) ~|w~|}}
#ALIAS get_color {#var colors {y|g|b|r|c|p};#var bright_colors {by|bg|bb|br|bc|bp};#ad ccc 1;#if (@ccc>%numitems(@colors)) {#var ccc 1};#var clr %item(@colors,@ccc);#var bclr %item(@bright_colors,@ccc)}
#ALIAS resetrun {#var exp 0;#var cnt 0;#var lev 0;#var bash 0;#var sucbash 0;#var trip 0;#var suctrip 0;#var throw 0;#var sucthrow 0;#var rescue 0;#var sucrescue 0;#var death 0;#var deathloss 0;#var netxp 0;#var fleexp 0;#ec --- Resetting counters ---}

[1] Instead, you could just copy and paste it into a *.txt file. Then, in zMUD, go to "Settings -> File -> Import Text" and select the file you saved to.

Usage

After adding everything line by line, be sure to use resetrun at least once before you run, so all the variables exist.

To set the worship part to the right deity, just look at your score. Otherwise, or for atheist, it will show Snikt.

The command runreport shows run stats. If you haven't died and did nothing special, it will just show your xp. If you've died or fled, it will show you what you lost. If you've bashed, tripped, thrown or rescued, it will show you the, succesful and total, number of those.

The command resetrun will reset the counters.

How It Works

I really don't want to get into that now :P I'll do it later.