Difference between revisions of "Zmud Spellbot (Guaritore)"

From AvatarWiki
Jump to navigation Jump to search
Line 4: Line 4:
 
''Copy each line individually and then paste them into zMud'' <sup>[1]</sup>'':''
 
''Copy each line individually and then paste them into zMud'' <sup>[1]</sup>'':''
 
  #CLASS {spells}
 
  #CLASS {spells}
#VAR mana ""
+
#VAR mana ""
#VAR spellcount ""
+
#VAR spellcount ""
#VAR spelltarget ""
+
#VAR spelltarget ""
#VAR spelllist ""
+
#VAR spelllist ""
#TRIGGER {%1 tells the group 'full'} {#var spelltarget %1;#if (!%ismember( %1, @spelllist)) {gt You're not on the list. GT 'next' without the quotes to be added};#if (%ismember( %1, @spelllist)) {#IF ((%1 != %item( @spelllist, 1)) & (@mana < 1500)) {gt You'll have to wait your turn and I need more mana. @mana/1600};#IF ((%1 != %item( @spelllist, 1)) & (@mana >= 1500)) {gt You'll have to wait your turn};#IF ((%1 = %item( @spelllist, 1)) & (@mana < 1500)) {gt You're next but I need more mana. @mana/1500};#IF ((%1 = %item( @spelllist, 1)) & (@mana >= 1500)) {#ad spellcount 1;wake;tell %1 water will be last;c 'holy sight' %1;c foci %1;c fort %1;c invin %1;c awen %1;tell %1 all done;c wa %1;#delitem spelllist %1;sleep;#ad spells/list/%1 1}}}
+
#TRIGGER {%1 tells the group 'full'} {#var spelltarget %1;#if (!%ismember( %1, @spelllist)) {gt You're not on the list. GT 'next' without the quotes to be added};#if (%ismember( %1, @spelllist)) {#IF ((%1 != %item( @spelllist, 1)) & (@mana < 1500)) {gt You'll have to wait your turn and I need more mana. @mana/1600};#IF ((%1 != %item( @spelllist, 1)) & (@mana >= 1500)) {gt You'll have to wait your turn};#IF ((%1 = %item( @spelllist, 1)) & (@mana < 1500)) {gt You're next but I need more mana. @mana/1500};#IF ((%1 = %item( @spelllist, 1)) & (@mana >= 1500)) {#ad spellcount 1;wake;tell %1 water will be last;c 'holy sight' %1;c foci %1;c fort %1;c invin %1;c awen %1;tell %1 all done;c wa %1;#delitem spelllist %1;sleep;#ad spells/list/%1 1}}}
#TRIGGER {%1 tells the group 'split'} {#var spelltarget %1;#if (!%ismember( %1, @spelllist)) {gt You're not on the list. GT 'next' without the quotes to be added};#if (%ismember( %1, @spelllist)) {#IF ((%1 != %item( @spelllist, 1)) & (@mana < 1500)) {gt You'll have to wait your turn and I need more mana. @mana/1600};#IF ((%1 != %item( @spelllist, 1)) & (@mana >= 1500)) {gt You'll have to wait your turn};#IF ((%1 = %item( @spelllist, 1)) & (@mana < 1500)) {gt You're next but I need more mana. @mana/1500};#IF ((%1 = %item( @spelllist, 1)) & (@mana >= 1500)) {#ad spellcount 1;wake;tell %1 water will be last;c 'holy sight' %1;c foci %1;c fort %1;c invin %1;c armor %1;c 'holy armor' %1;c 'holy aura' %1;c bless %1;c sanc %1;tell %1 all done;c wa %1;#delitem spelllist %1;#ad spells/list/%1 1;sleep}}}
+
#TRIGGER {%1 tells the group 'split'} {#var spelltarget %1;#if (!%ismember( %1, @spelllist)) {gt You're not on the list. GT 'next' without the quotes to be added};#if (%ismember( %1, @spelllist)) {#IF ((%1 != %item( @spelllist, 1)) & (@mana < 1500)) {gt You'll have to wait your turn and I need more mana. @mana/1600};#IF ((%1 != %item( @spelllist, 1)) & (@mana >= 1500)) {gt You'll have to wait your turn};#IF ((%1 = %item( @spelllist, 1)) & (@mana < 1500)) {gt You're next but I need more mana. @mana/1500};#IF ((%1 = %item( @spelllist, 1)) & (@mana >= 1500)) {#ad spellcount 1;wake;tell %1 water will be last;c 'holy sight' %1;c foci %1;c fort %1;c invin %1;c armor %1;c 'holy armor' %1;c 'holy aura' %1;c bless %1;c sanc %1;tell %1 all done;c wa %1;#delitem spelllist %1;#ad spells/list/%1 1;sleep}}}
#TRIGGER {%1 tells the group 'next'} {#additem spelllist %1;gt |BC|People in line: @spelllist;gt |BC|gt |BR|split full |BC|or |BR|help|BC| to see a list of all other spells/commands;gt |BM|Please check your alignment, i cannot fullspell evil chars;gt |BC|gt 'split awen' without the quotes if you didn't check your align and just need the awen spells}
+
#TRIGGER {%1 tells the group 'next'} {#additem spelllist %1;gt |BC|People in line: @spelllist;gt |BC|gt |BR|split full |BC|or |BR|help|BC| to see a list of all other spells/commands;gt |BM|Please check your alignment, i cannot fullspell evil chars;gt |BC|gt 'split awen' without the quotes if you didn't check your align and just need the awen spells}
#TRIGGER {joins your group.} {gt |BC|gt |BR|'next'|BC| without the quotes to be added to the queue for |BR|FULL |BC|and |BR|SPLIT |BC|spells;gt |BC|gt |BR|help |BC|for a list of all available spells/commands;gt |BC|if someone is not responding or queue is not empty when it should be gt clear then gt next to rejoin the queue.}
+
#TRIGGER {joins your group.} {gt |BC|gt |BR|'next'|BC| without the quotes to be added to the queue for |BR|FULL |BC|and |BR|SPLIT |BC|spells;gt |BC|gt |BR|help |BC|for a list of all available spells/commands;gt |BC|if someone is not responding or queue is not empty when it should be gt clear then gt next to rejoin the queue.}
#TRIGGER {%1 tells the group 'help'} {gt |BC|gt split, full, invin, invis, sanc, frenzy, fort, foci, wa(waterbreathing), invig, holy sight, remove curse, div, div2, div3, div4, div5, split awen(just awen spells), pp(portal), next(to be added to the queue), line(for list of queue), clear(clears queue DO NOT ABUSE)}
+
#TRIGGER {%1 tells the group 'help'} {gt |BC|gt split, full, invin, invis, sanc, frenzy, fort, foci, wa(waterbreathing), invig, holy sight, remove curse, div, div2, div3, div4, div5, split awen(just awen spells), pp(portal), next(to be added to the queue), line(for list of queue), clear(clears queue DO NOT ABUSE)}
#TRIGGER {%1 tells the group 'sanc'} {wake;c sanc %1;sleep}
+
#TRIGGER {%1 tells the group 'sanc'} {wake;c sanc %1;sleep}
#TRIGGER {%1 tells the group 'split awen'} {wake;c armor %1;c 'holy armor' %1;c 'holy aura' %1;c bless %1;c sanc %1;sleep}
+
#TRIGGER {%1 tells the group 'split awen'} {wake;c armor %1;c 'holy armor' %1;c 'holy aura' %1;c bless %1;c sanc %1;sleep}
#TRIGGER {%1 tells the group 'invin'} {wake;c invin %1;sleep}
+
#TRIGGER {%1 tells the group 'invin'} {wake;c invin %1;sleep}
#TRIGGER {%1 tells the group 'div'} {wake;c div %1;sleep}
+
#TRIGGER {%1 tells the group 'div'} {wake;c div %1;sleep}
#TRIGGER {%1 tells the group 'div2'} {wake;augment 2;c div %1;augment off;sleep}
+
#TRIGGER {%1 tells the group 'div2'} {wake;augment 2;c div %1;augment off;sleep}
#TRIGGER {%1 tells the group 'div3'} {wake;augment 3;c div %1;augment off;sleep}
+
#TRIGGER {%1 tells the group 'div3'} {wake;augment 3;c div %1;augment off;sleep}
#TRIGGER {%1 tells the group 'div4'} {wake;augment 4;c div %1;augment off;sleep}
+
#TRIGGER {%1 tells the group 'div4'} {wake;augment 4;c div %1;augment off;sleep}
#TRIGGER {%1 tells the group 'div5'} {wake;augment 5;c div %1;augment off;sleep}
+
#TRIGGER {%1 tells the group 'div5'} {wake;augment 5;c div %1;augment off;sleep}
#TRIGGER {%1 stops following you.} {#delitem spelllist %1}
+
#TRIGGER {%1 stops following you.} {#delitem spelllist %1}
#TRIGGER {%1 tells the group 'clear'} {#var spelllist "";sleep}
+
#TRIGGER {%1 tells the group 'clear'} {#var spelllist "";sleep}
#TRIGGER {%1 tells the group 'remove curse'} {wake;c 'remove curse' %1;sleep}
+
#TRIGGER {%1 tells the group 'remove curse'} {wake;c 'remove curse' %1;sleep}
#TRIGGER {%1 now follows you.} {group %1}
+
#TRIGGER {%1 now follows you.} {group %1}
#TRIGGER {Your senses return to normal.} {wake;heighten;sleep}
+
#TRIGGER {Your senses return to normal.} {wake;heighten;sleep}
#TRIGGER {%1 tells the group 'line'} {gt People in line: @spelllist}
+
#TRIGGER {%1 tells the group 'line'} {gt People in line: @spelllist}
#TRIGGER {tells you} {#cap spellcap}
+
#TRIGGER {tells you} {#cap spellcap}
#TRIGGER {You dream of %1 telling you} {#cap spellcap}
+
#TRIGGER {You dream of %1 telling you} {#cap spellcap}
#TRIGGER {%1 tells the group 'fort'} {wake;c fort %1;sleep}
+
#TRIGGER {%1 tells the group 'fort'} {wake;c fort %1;sleep}
#TRIGGER {%1 tells the group 'foci'} {wake;c foci %1;sleep}
+
#TRIGGER {%1 tells the group 'foci'} {wake;c foci %1;sleep}
#TRIGGER {%1 tells the group 'wa'} {wake;c wa %1;sleep}
+
#TRIGGER {%1 tells the group 'wa'} {wake;c wa %1;sleep}
#TRIGGER {tells the group 'pp %1'} {wake;c portal %1;sleep}
+
#TRIGGER {tells the group 'pp %1'} {wake;c portal %1;sleep}
#TRIGGER {%1 tells the group 'invig'} {wake;c invig %1;sleep}
+
#TRIGGER {%1 tells the group 'invig'} {wake;c invig %1;sleep}
#TRIGGER {%1 tells the group 'frenzy'} {wake;c frenzy %1;sleep}
+
#TRIGGER {%1 tells the group 'frenzy'} {wake;c frenzy %1;sleep}
#TRIGGER {You fail to heighten your senses.} {wake;heighten;sleep}
+
#TRIGGER {You fail to heighten your senses.} {wake;heighten;sleep}
#TRIGGER {%1 tells the group 'holy sight'} {wake;c 'holy sight' %1;sleep}
+
#TRIGGER {%1 tells the group 'holy sight'} {wake;c 'holy sight' %1;sleep}
#TRIGGER {%1 tells the group 'invis'} {wake;c invis %1;sleep}
+
#TRIGGER {%1 tells the group 'invis'} {wake;c invis %1;sleep}
#TRIGGER {Spells: %1 mana} {#var mana %1}
+
#TRIGGER {Spells: %1 mana} {#var mana %1}
#CLASS 0
+
#CLASS 0
 
 
 
 
== 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 ==
 
#TRIGGER {^You receive (%d) experience points.} {#ad exp %1;#ad netxp %1;#ad cnt 1} {runcounter}
 
#TRIGGER {^Death sucks (%*) experience points from you as payment for resurrection.} {#ad death 1;#ad deathloss %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}
 
All of these keep track of your xp gains and losses. 'exp' is the variable for the experience gained, whereas 'netxp' is the netto xp, with losses from fleeing and deaths subtracted. 'cnt' is the number of kills.
 
 
 
#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}
 
This line keeps track of the amount of levels you get. It also outputs, in an emote for all to see, what your gains are.
 
 
 
#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}
 
All these count the number of bashes, throws, trips and rescues. It also keeps track of whether or not you fail them.
 
 
 
#VAR worship {Snikt}
 
#TRIGGER {You are (%*) and a worshipper of (%x).} {#var worship %2} {runcounter}
 
For the final output, it can matter what deity you worship since some modify your xp gains or losses. Whenever you check your score window, this line will switch you to your deity. Default is Snikt, declared in the #VAR line.
 
 
 
#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 ~and~/~or recalling) so my net gain is |@bclr|@netxp|bk| xp.};stats}
 
Here's where it gets tricky. All the tildes (~) are used to make sure zMUD outputs them into your window, since they're all parts of commands if not prefixed with a tilde. The first thing it does is call get_color, to select a random color (see #ALIAS get_color). Then the reports come in. The first line will look like this:
 
This run, Snikt gave me: a xp, b kills, c levels.
 
After that, the #if's begin. The next line, between the semicolons (;) checks if you've died or fled/recalled from combat. If so, it will tell you how much you've lost from this, and outputs your net gains. It will look like this:
 
I've lost a xp by b deaths and c xp from fleeing and/or recalling so my net gain is d xp.
 
After that, the alias calls the next alias, 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~|}}
 
Stats outputs your bash, trip, throw and rescue scores, in that order. But, only when you've used the commands during your run. In the initial #if, it checks if you've used any of the commands. If you've used them, then it will continue with what's further down the line between the curly brackets ({}). There, between the brackets, it checks per skill if you've used them, and if so, it will output the results. It will look something like this:
 
Bashes: 1/2 Trips: 1/2 Throws: 1/2 Rescues: 1/2
 
Assuming, of course, you've used all commands twice and failed em all once out of the two attempts.
 
 
 
#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)}
 
This is an alias that stores all the possible colors in an array. You can (randomly) change the color used with get_color, use that color with @clr or the bright version of that color with @bclr. Can be nice, makes for a dynamic output.
 
 
 
#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 ---}
 
This is the last alias, and it sets your variables all to 0 (except for worship, which shouldn't have to reset itself since it's not used cumulatively. The last part, '#ec --- Resetting counters ---' is only visible to you, as a local echo.
 
 
 
 
[[Category: Zmud Scripting]]
 
[[Category: Zmud Scripting]]

Revision as of 10:01, 9 August 2008

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]:

#CLASS {spells}
#VAR mana ""
#VAR spellcount ""
#VAR spelltarget ""
#VAR spelllist ""
#TRIGGER {%1 tells the group 'full'} {#var spelltarget %1;#if (!%ismember( %1, @spelllist)) {gt You're not on the list. GT 'next' without the quotes to be added};#if (%ismember( %1, @spelllist)) {#IF ((%1 != %item( @spelllist, 1)) & (@mana < 1500)) {gt You'll have to wait your turn and I need more mana. @mana/1600};#IF ((%1 != %item( @spelllist, 1)) & (@mana >= 1500)) {gt You'll have to wait your turn};#IF ((%1 = %item( @spelllist, 1)) & (@mana < 1500)) {gt You're next but I need more mana. @mana/1500};#IF ((%1 = %item( @spelllist, 1)) & (@mana >= 1500)) {#ad spellcount 1;wake;tell %1 water will be last;c 'holy sight' %1;c foci %1;c fort %1;c invin %1;c awen %1;tell %1 all done;c wa %1;#delitem spelllist %1;sleep;#ad spells/list/%1 1}}}
#TRIGGER {%1 tells the group 'split'} {#var spelltarget %1;#if (!%ismember( %1, @spelllist)) {gt You're not on the list. GT 'next' without the quotes to be added};#if (%ismember( %1, @spelllist)) {#IF ((%1 != %item( @spelllist, 1)) & (@mana < 1500)) {gt You'll have to wait your turn and I need more mana. @mana/1600};#IF ((%1 != %item( @spelllist, 1)) & (@mana >= 1500)) {gt You'll have to wait your turn};#IF ((%1 = %item( @spelllist, 1)) & (@mana < 1500)) {gt You're next but I need more mana. @mana/1500};#IF ((%1 = %item( @spelllist, 1)) & (@mana >= 1500)) {#ad spellcount 1;wake;tell %1 water will be last;c 'holy sight' %1;c foci %1;c fort %1;c invin %1;c armor %1;c 'holy armor' %1;c 'holy aura' %1;c bless %1;c sanc %1;tell %1 all done;c wa %1;#delitem spelllist %1;#ad spells/list/%1 1;sleep}}}
#TRIGGER {%1 tells the group 'next'} {#additem spelllist %1;gt |BC|People in line: @spelllist;gt |BC|gt |BR|split full |BC|or |BR|help|BC| to see a list of all other spells/commands;gt |BM|Please check your alignment, i cannot fullspell evil chars;gt |BC|gt 'split awen' without the quotes if you didn't check your align and just need the awen spells}
#TRIGGER {joins your group.} {gt |BC|gt |BR|'next'|BC| without the quotes to be added to the queue for |BR|FULL |BC|and |BR|SPLIT |BC|spells;gt |BC|gt |BR|help |BC|for a list of all available spells/commands;gt |BC|if someone is not responding or queue is not empty when it should be gt clear then gt next to rejoin the queue.}
#TRIGGER {%1 tells the group 'help'} {gt |BC|gt split, full, invin, invis, sanc, frenzy, fort, foci, wa(waterbreathing), invig, holy sight, remove curse, div, div2, div3, div4, div5, split awen(just awen spells), pp(portal), next(to be added to the queue), line(for list of queue), clear(clears queue DO NOT ABUSE)}
#TRIGGER {%1 tells the group 'sanc'} {wake;c sanc %1;sleep}
#TRIGGER {%1 tells the group 'split awen'} {wake;c armor %1;c 'holy armor' %1;c 'holy aura' %1;c bless %1;c sanc %1;sleep}
#TRIGGER {%1 tells the group 'invin'} {wake;c invin %1;sleep}
#TRIGGER {%1 tells the group 'div'} {wake;c div %1;sleep}
#TRIGGER {%1 tells the group 'div2'} {wake;augment 2;c div %1;augment off;sleep}
#TRIGGER {%1 tells the group 'div3'} {wake;augment 3;c div %1;augment off;sleep}
#TRIGGER {%1 tells the group 'div4'} {wake;augment 4;c div %1;augment off;sleep}
#TRIGGER {%1 tells the group 'div5'} {wake;augment 5;c div %1;augment off;sleep}
#TRIGGER {%1 stops following you.} {#delitem spelllist %1}
#TRIGGER {%1 tells the group 'clear'} {#var spelllist "";sleep}
#TRIGGER {%1 tells the group 'remove curse'} {wake;c 'remove curse' %1;sleep}
#TRIGGER {%1 now follows you.} {group %1}
#TRIGGER {Your senses return to normal.} {wake;heighten;sleep}
#TRIGGER {%1 tells the group 'line'} {gt People in line: @spelllist}
#TRIGGER {tells you} {#cap spellcap}
#TRIGGER {You dream of %1 telling you} {#cap spellcap}
#TRIGGER {%1 tells the group 'fort'} {wake;c fort %1;sleep}
#TRIGGER {%1 tells the group 'foci'} {wake;c foci %1;sleep}
#TRIGGER {%1 tells the group 'wa'} {wake;c wa %1;sleep}
#TRIGGER {tells the group 'pp %1'} {wake;c portal %1;sleep}
#TRIGGER {%1 tells the group 'invig'} {wake;c invig %1;sleep}
#TRIGGER {%1 tells the group 'frenzy'} {wake;c frenzy %1;sleep}
#TRIGGER {You fail to heighten your senses.} {wake;heighten;sleep}
#TRIGGER {%1 tells the group 'holy sight'} {wake;c 'holy sight' %1;sleep}
#TRIGGER {%1 tells the group 'invis'} {wake;c invis %1;sleep}
#TRIGGER {Spells: %1 mana} {#var mana %1}
#CLASS 0