Zist Sample Triggers

From RoDpedia
Revision as of 04:34, 6 July 2023 by Blithe (talk | contribs)
Jump to navigation Jump to search

Sample Triggers

These "Trigger Sets" either contain single triggers, multiple triggers, triggers and supporting aliases, or any combination thereof. Click on each link to open the window for that sample trigger set. Viewable and downloadable code for each is provided to make it as easy as possible for you to import them.

AUTOPRACTICE SKILLS & SPELLS TRIGGER/ALIAS SET

Getting a character to autopractice skills and/or spells is relatively easy. It only requires one trigger and one alias. The trigger functions to determine when to call the alias, and the alias parses a list of items requiring practice and sends one to the mud. Of course, you have to customize the alias with the skills and/or spells you want to practice. Also note that this particular example is designed to cause a character to autopractice skills and/or spells when fighting. If you simply wish to automate practicing non-fighting skills then add the alias "autoprac" to your ticktimer alias (see the ticktimer section for more details) to cause the autoprac alias to fire every time your ticktimer expires.

Here is the trigger of the autopractice trigger/alias set:

#TRIGGER {^Your} {autoprac} {autop}

This trigger will fire off of the pattern of "^Your", when it fires it calls the autoprac alias, and it is associated with the class name of "autop". So why trigger off of any line that begins with "Your"? Well, when you are fighting (at least on Realms of Despair), whenever you take a swing at a mob the line you see starts with "Your"... For example : "Your kick misses the carrion crawler" or "Your blast brushes Brunhilde the Valkyrie". In this way, fighting styles can be adepted at the quickest speed possible, since styles only go up when you switch between them alot and do damamge to a mob inbetween switching. Casting spells in autopractice when fighting is not generally recommended, because you run out of mana too fast at low levels. However, I have included one spell in the example of the autoprac alias just in case you wanted to use it for that, or wanted to put it in your ticktimer and turn off the trigger to autopractice non-fighting skills and spells.

Here is the alias "autoprac":

#ALIAS autoprac {#var praclist {"kick style-aggressive style-standard cast-'black-hand'"};#var praclistlen %numwords(@praclist);#if (@pracnum > @praclistlen) {#var pracnum 1};#if (@pracnum < 1) {#var pracnum 1};#var pracitem 
%word(@biglist,@pracnum);#var pracitem %replace(@pracitem,"-"," ");@pracitem;#math pracnum @pracnum+1} {autop}

This alias consists of 8 lines of commands. Here they are, one by one:

LINE #1 - #var praclist {"kick style-aggressive style-standard cast-'black-hand'"}

--- This sets up the variable @praclist with a list of things to practice. In this example, the first time the alias is called it will enter the "kick" command. The second time will get the "style aggressive" command. The third will get the "style standard" command. The fourth will get the "cast 'black hand'" command. Notice how the commands have dashes in them, but are separated by spaces? This is the format you must use if you want to add more commands or replace the ones here. Any mud command can be placed in this list, provided it has a space before it and has dashes in it instead of the usual spaces. The reason for this will be evident in LINE #2, LINE #5, and LINE #6.

LINE #2 - #var praclistlen %numwords(@praclist)

--- This line looks at how many "space delimited words" are in @praclist and sets the variable @praclistlen to the number of "words" it found. Since there are spaces between the commands set in LINE #1, the @praclistlen would be set to the number "4" for the above example. Without spaces between them, the %numwords function would fail to count the correct number of words.

LINE #3 - #if (@pracnum > @praclistlen) {#var pracnum 1}

--- This line checks the value of @pracnum against the value of @praclistlen, and if @pracnum larger than @praclistlen then @pracnum is set to the value of "1". The number in @pracnum will be used to select which command is pulled from the list and sent to the MUD. If the @pracnum number is higher than the number of available commands, then it is reset to 1 so that there aren't any errors, and to start the practice cycle over again with the first command.

LINE #4 - #if (@pracnum < 1) {#var pracnum 1}

--- This does a simple check to see if @pracnum is smaller than the value "1". If it is, then it is out of range and is set to 1 to avoid any errors. Most often, this is used when the alias is executed for the first time, and keeps it from crashing zmud with invalid values.

LINE #5 - #var pracitem %word(@praclist,@pracnum)

--- This line sets the variable @pracitem to a word from @praclist, indexed by @pracnum. So if @pracnum has a value of 1, this line would set @pracitem to contain "kick", the first word in the list. If @pracnum has a value of 2, this line would set @pracitem to contain "style-aggressive", the second word in the list. It simply pulls the word from the list, indexed by the number in @pracnum, and puts that word in @pracitem. For the %word function to work as coded, the "words" in @praclist would have to be separated by spaces. This is another reason that the commands have dashes in them instead of spaces.

LINE #6 - #var pracitem %replace(@pracitem,"-"," ")

--- This line takes the command in @pracitem and changes every dash to a space. This "fixes" the command so that it can be sent to the mud without dashes in it. The dashes were needed to keep the commands separate in the list, and now that the command has been isolated, it's dashes are replaced with spaces. This would take the command "cast-'black-hand'" an change it to "cast 'black hand'", as it should be before sending to the mud. This may seem like an extra step, but it actually makes the alias easier to customize and less confusing.

LINE #7 - @pracitem

--- This command is just a variable name, on a line by itself. When zMud sees this, it expands (or "replaces") this line with the contents of @pracitem and sends it to the mud. In other words, this takes the command pulled out of the list and sends it to the mud. If the command was "kick" then this line would send "kick" to the mud just as though you had typed kick and hit enter on your command line.

LINE #8 - #math pracnum @pracnum+1

--- This line takes the number in @pracnum, adds 1 to it, and saves it back to @pracnum. In other words, it increments @pracnum by 1. If @pracnum had "1" in it, then it has "2" in it when this line is done. In this way, this autoprac alias "cycles through" all of the words in the list, one by one, before it starts over again.

SCRIPT

#TRIGGER {^Your} {autoprac} {autop}

#ALIAS autoprac {#var praclist {"kick style-aggressive style-standard cast-'black-hand'"};#var praclistlen %numwords(@praclist);#if (@pracnum > @praclistlen) {#var pracnum 1};#if (@pracnum < 1) {#var pracnum 1};#var pracitem 
%word(@praclist,@pracnum);#var pracitem %replace(@pracitem,"-"," ");@pracitem;#math pracnum @pracnum+1} {autop}


COLOR SPECIFIC TEXT LINES THE WAY YOU WANT THEM TRIGGER SET

Making any line you want display as any color you want is easily done in zMud. While the color selections are somewhat limited to 10 basic colors, the options exist to change both the text color and the background color for that line. It is also a simple thing to make colors brighter or bolder. Here, then is a list of some simple triggers you can use to color the text you see from various chat channels so that they stand out from the rest:

#TRIGGER {bright} {#cw green} {bright}

--- NOTE: the #CW command colors only one word... so this example will color the word "bright" the color green whenever it comes across your window. This make make for some strange effects, when the word "brighten" comes across and only the letters "bright" are in green!

#TRIGGER {^(%w) chats} {#color 14} {chatcolor}

#TRIGGER {^(%w) asks} {#color 12} {askcolor}

#TRIGGER {^(%w) guildtalks} {#color 13} {guildtalkscolor}

#TRIGGER {^(%w) ordertalks} {#color 13} {ordertalkscolor}

#TRIGGER {^(%w) racetalks} {#color 7} {racetalkscolor}

#TRIGGER {^(%w) newbiechats} {#color 159} {newbiechatcolor}

#TRIGGER {^(%w) counciltalks} {#color 13;#var lasttrig %trigger;#mes @lasttrig} {counciltalkscolor}

NOTE : The last trigger has an extra feature in it. The #MES command takes the text you give it, and creates a popup message box that shows the text for about 10 seconds or so. This can be handy if you are waiting for a tell from someone, or always want to make sure you see a specific channel or text. If overused, the #MES command can get spammy and annoying because it does a focus switch and your cursor leaves your command line... so if you were typing a command it would be cut off and your keystrokes would be lost. But, it is handy to get your attention when your busy with other things.

For your convenience I have included below the text from the help file on how the color command can be programmed.


COLOR
Syntax: #CO attribute [pattern]
Related: #HIGHLIGHT

Example

If the pattern parameter is left out, this command changes the color of the last line received from the MUD. The color attribute can be a numeric attribute (compatible with the attribute values used by the text modes of DOS) or 
can be a combination of string values listed below, separated by commas.
If the pattern is included, a trigger is created to color any line matching the given pattern with the specified color.
Color values:
black---0
blue----1
green---2
cyan----3
red-----4
magenta-5
brown---6
grey----7
yellow--14
white---15
bold----128
to make a color brighter, add 8 to the base value. For example, 9 is bright blue. To change the background color, rather than the foreground, multiply the base value by 16. For example, to get a red background, use 4*16 or 64. To 
make the foreground font bold, add 128 to the value.

Thus, a bold white on a blue background would be 128 + 1*16 + 15 = 159.

SCRIPT

#TRIGGER {bright} {#cw green} {bright}

#TRIGGER {^(%w) chats} {#color 14} {chatcolor}

#TRIGGER {^(%w) asks} {#color 12} {askcolor}

#TRIGGER {^(%w) guildtalks} {#color 13} {guildtalkscolor}

#TRIGGER {^(%w) ordertalks} {#color 13} {ordertalkscolor}

#TRIGGER {^(%w) racetalks} {#color 7} {racetalkscolor}

#TRIGGER {^(%w) newbiechats} {#color 159} {newbiechatcolor}

#TRIGGER {^(%w) counciltalks} {#color 13;#var lasttrig %trigger;#mes @lasttrig} {counciltalkscolor}

Equipment Look Set

This trigger/alias set reads an equipment look-set that comes across your screen (i.e. what someone is wearing in the game) and then reports which item slots are missing. It is implemented in one alias and two triggers. The second trigger is not defined here because it is a prompt trigger and that must be defined by you. However, the command that you need to add to your prompt trigger is included. And in case you were wondering, a prompt trigger is a trigger that goes off every time your prompt comes across the screen.

The main trigger of this set, shown below, triggers off of lines that start with the character "<", so that it can catch every equipment line that comes across. It searches that line for an equipment position identifier, such as "used as light", and sets a variable to 1 if it finds that line. That's all it does is sets variables to 1 when it finds the corresponding line! It also sets the @eqlist variable to 1, to signify that the trigger has gone off and collected equipment data. The alias takes it from there...

#TRIGGER {^<*} {#if (%pos(used as light,%trigger) > 0) {#var eqli 1};#if (%pos(worn on finger,%trigger) > 0) {#math eqfi @eqfi+1};#if (%pos(worn around neck,%trigger) > 0) {#math eqn @eqn+1};#if (%pos(worn on body,%trigger) > 0) 
{#var eqb 1};#if (%pos(worn on head,%trigger) > 0) {#var eqhe 1};#if (%pos(worn on legs,%trigger) > 0) {#var eqle 1};#if (%pos(worn on feet,%trigger) > 0) {#var eqfe 1};#if (%pos(worn on hands,%trigger) > 0) {#var eqha 1};#if 
(%pos(worn on arms,%trigger) > 0) {#var eqa 1};#if (%pos(worn as shield,%trigger) > 0) {#var eqs 1};#if (%pos(worn about body,%trigger) > 0) {#var eqab 1};#if (%pos(worn about waist,%trigger) > 0) {#var eqawa 1};#if (%pos(worn 
around wrist,%trigger) > 0) {#math eqawr @eqawr+1};#if (%pos(wielded,%trigger) > 0) {#var eqw 1};#if (%pos(dual wielded,%trigger) > 0) {#var eqdw 1};#if (%pos(held,%trigger) > 0) {#var eqh 1};#if (%pos(worn on ears,%trigger) > 0) 
{#var eqea 1};#if (%pos(worn on eyes,%trigger) > 0) {#var eqey 1};#var eqlist 1} {eq}

The main alias, "eqmissing", reads the variables set by the trigger and reports for each one that is set to 0, meaning that it was not found. It also sets @eqlist to 0, to signify that the eqmissing alias has fired and the report was generated, and clears all equipment slot variables to 0 again.

#ALIAS eqmissing {#var eqlist 0;#show ******** START OF MISSING EQ LIST ********;#if (@eqli = 0) {#show LIGHT IS MISSING};#if (@eqfi < 2) {#show FINGER IS MISSING};#if (@eqn < 2) {#show NECK IS MISSING};#if (@eqb = 0) {#show BODY 
IS MISSING};#if (@eqhe = 0) {#show HEAD IS MISSING};#if (@eqle = 0) {#show LEGS IS MISSING};#if (@eqfe = 0) {#show FEET IS MISSING};#if (@eqha = 0) {#show HANDS IS MISSING};#if (@eqa = 0) {#show ARMS IS MISSING};#if (@eqs = 0) 
{#show SHIELD IS MISSING};#if (@eqab = 0) {#show ABOUT BODY IS MISSING};#if (@eqawa = 0) {#show ABOUT WAIST IS MISSING};#if (@eqawr < 2) {#show AROUND WRIST IS MISSING};#if (@eqw = 0) {#show WIELDED IS MISSING};#if (@eqdw = 0) 
{#show DUAL-WIELDED IS MISSING};#if (@eqh = 0) {#show HELD IS MISSING};#if (@eqea = 0) {#show EARS IS MISSING};#if (@eqey = 0) {#show EYES IS MISSING};#show ******** DONE WITH MISSING LIST ********;#var eqli 0;#var eqfi 0;#var eqn 
0;#var eqb 0;#var eqhe 0;#var eqle 0;#var eqfe 0;#var eqha 0;#var eqa 0;#var eqs 0;#var eqab 0;#var eqawa 0;#var eqawr 0;#var eqw 0;#var eqdw 0;#var eqh 0;#var eqea 0;#var eqey 0;#noop set all equipment slot variables to zero} 
{eq}

The third part requires that you add the following command to your prompt trigger. This command line checks the @eqlist variable and if it is set to 1 (meaning that the eqmissing trigger has fired and collected missing line data) then it calls the eqmissing alias to report on the findings. Here is the command to add:


#if (@eqlist = 1) {eqmissing}

Here is a sample of a run of this trigger/alias set:

eq
You are using:
< used as light > the sigil of A'enaar
< worn on finger > (Humming) the Ring of Dignity
< worn on finger > (Humming) the Ring of Dignity
< worn around neck > a blue-silver iron gorget
< worn around neck > a blue-silver iron gorget
< worn on body > (Magical) the Livery of the Sea King
< worn on head > (Glowing) (Humming) Memories of Spring
< worn on legs > (Red Aura) (Magical) leggings of dark dragonscale
< worn on feet > Silver boots of Camelot
< worn on hands > (Glowing) (Humming) dragon's gloves
< worn on arms > iron bracers
< worn as shield > a bulette carapace shield
< worn about body > a mind flayer's robe
< worn about waist > a red satin sash
< worn around wrist > a gold chain bracelet
< worn around wrist > a mind flayer tentacle
< wielded > Neptune's Trident
< held > (Glowing) the golden staff of the Hunter
< worn on ears > (Magical) a sailor's earring
< worn on eyes > (Magical) (Glowing) an oracle of prescience
{926/926h|491/491mp|540/540mv|5486321xp|day|387plyrs}******** START OF MISSING EQ LIST ********
DUAL-WIELDED IS MISSING
******** DONE WITH MISSING LIST ********

NOTES: The text "{926/926h|491/491mp|540/540mv|5486321xp|day|387plyrs}" is an example of one of my prompts, and the prompt trigger that went off because that line came across the mud called the "eqmissing" alias because I have the "#if (@eqlist = 1) {eqmissing}" command coded in it's command-list. Also, "DUAL-WIELDED IS MISSING" is the above missing list because the equipment list doesn't include something is dual-wielded.

A final customization: If you do not wish to set up a prompt trigger, or do not have one, then you can simply type the "eqmissing" alias command yourself after inspecting yours or someone else's equipment list. The results will be the same. However, it is better to make this trigger automatic if possible, and a prompt trigger is a handy way to do this.

SCRIPT

#TRIGGER {^<*} {#if (%pos(used as light,%trigger)  > 0) {#var eqli 1};#if (%pos(worn on finger,%trigger) > 0) {#math eqfi @eqfi+1};#if (%pos(worn around neck,%trigger) > 0) {#math eqn @eqn+1};#if (%pos(worn on body,%trigger) > 0) 
{#var eqb 1};#if (%pos(worn on head,%trigger) > 0) {#var eqhe 1};#if (%pos(worn on legs,%trigger) > 0) {#var eqle 1};#if (%pos(worn on feet,%trigger) > 0) {#var eqfe 1};#if (%pos(worn on hands,%trigger) > 0) {#var eqha 1};#if 
(%pos(worn on arms,%trigger) > 0) {#var eqa 1};#if (%pos(worn as shield,%trigger) > 0) {#var eqs 1};#if (%pos(worn about body,%trigger) > 0) {#var eqab 1};#if (%pos(worn about waist,%trigger) > 0) {#var eqawa 1};#if (%pos(worn 
around wrist,%trigger) > 0) {#math eqawr @eqawr+1};#if (%pos(wielded,%trigger) > 0) {#var eqw 1};#if (%pos(dual wielded,%trigger) > 0) {#var eqdw 1};#if (%pos(held,%trigger) > 0) {#var eqh 1};#if (%pos(worn on ears,%trigger) > 0) 
{#var eqea 1};#if (%pos(worn on eyes,%trigger) > 0) {#var eqey 1};#var eqlist 1} {eq}

#ALIAS eqmissing {#var eqlist 0;#show ******** START OF MISSING EQ LIST ********;#if (@eqli = 0) {#show LIGHT IS MISSING};#if (@eqfi < 2) {#show FINGER IS MISSING};#if (@eqn < 2) {#show NECK IS MISSING};#if (@eqb = 0) {#show BODY 
IS MISSING};#if (@eqhe = 0) {#show HEAD IS MISSING};#if (@eqle = 0) {#show LEGS IS MISSING};#if (@eqfe = 0) {#show FEET IS MISSING};#if (@eqha = 0) {#show HANDS IS MISSING};#if (@eqa = 0) {#show ARMS IS MISSING};#if (@eqs = 0) 
{#show SHIELD IS MISSING};#if (@eqab = 0) {#show ABOUT BODY IS MISSING};#if (@eqawa = 0) {#show ABOUT WAIST IS MISSING};#if (@eqawr < 2) {#show AROUND WRIST IS MISSING};#if (@eqw = 0) {#show WIELDED IS MISSING};#if (@eqdw = 0) 
{#show DUAL-WIELDED IS MISSING};#if (@eqh = 0) {#show HELD IS MISSING};#if (@eqea = 0) {#show EARS IS MISSING};#if (@eqey = 0) {#show EYES IS MISSING};#show ******** DONE WITH MISSING LIST ********;#var eqli 0;#var eqfi 0;#var eqn 
0;#var eqb 0;#var eqhe 0;#var eqle 0;#var eqfe 0;#var eqha 0;#var eqa 0;#var eqs 0;#var eqab 0;#var eqawa 0;#var eqawr 0;#var eqw 0;#var eqdw 0;#var eqh 0;#var eqea 0;#var eqey 0;#noop set all equipment slot variables to zero} 
{eq}


(Add this part to your prompt trigger:)
#if (@eqlist = 1) {eqmissing}

KILL BUFFER TRACKING TRIGGER/ALIAS SET

I'm quite proud of this set... These track your kill buffer. A limit of 50 entries is kept in the list, and when you get a 51st entry the oldest one drops off. Handy to know if you have cleared your buffer completely or not. Here is the code:

1. This is the only trigger of the set, and tracks kills. It detects the kill line, checks to see if you killed it, and if so, passes the mobname to the killlistadd routine to add it to the list or increment the number of kills for that mob in the list.

#TRIGGER {(%w) is DEAD!!} {#var linebefore1 %line2;#var fullmobname %replace(%left(%trigger,%pos(" is",%trigger))," ","");#show MOB : @fullmobname JUST DIED;#show LINE1BEFOREKILL : @linebefore1;#var killedit 
%word(@linebefore1,1);#if (%pos("You",@killedit) > 0) {#show YOU GOT THE KILL;killlistadd @fullmobname};#if (@look = 0) {look;#var look 1};save;#noop fullmobname = left portion of string before " is DEAD!" with spaces 
removed;#noop if you have "a young turtle is DEAD!" then fullmobname = "ayoungturtle"} {+} 5

2. The killlistclear alias clears the kill list and sets the number of entries of the kill list to zero. Use this to initialize the kill list before getting started, or when installing on a new character.

#ALIAS killlistclear {#var listokills {""};#var listkillnum 0;#show Kill List Emptied.} {killlist}

3. The killlistadd alias does the majority of the work. It checks the list to see if the mobname exists. If it exists, it increments the number of kills and deletes the old entry from the list and adds the new entry with updated total to the list. Additions to the list always go at the end, therefore the first entry in the list is always the oldest. If the mobname passed to this alias doesn't exist in the list then it adds that mobname to the end of the list and sets the kill total for that new mobname to one. Then this alias calls killlist50 to cause auto-deletion of entries that are too old (more than 50 entries, oldest goes away).

#ALIAS killlistadd {#var itemtoadd %1;#var numkills {""};#var itemtoadd2 {""};#var mobname {""};#var mobnameandnum {""};#var mobnamefound 0;#var listkillnum %numwords(@listokills,|);#show Scanning list for @itemtoadd;#if 
(@listkillnum > 0) {#loo 1,@listkillnum {#var itemtocheck %i;#math itemtocheck @listkillnum-@itemtocheck;#math itemtocheck @itemtocheck+1;#var itemtodel %word(@listokills,%i,|);#var listkillnum %numwords(@listokills,|);#var 
numkills %word(@itemtodel,1,/);#var mobname %word(@itemtodel,2,/);#if (@mobnamefound = 0) {#if (@mobname = @itemtoadd) {#show Found @itemtoadd;#var mobnamefound 1;#show REMOVING : @itemtodel;#var listokills 
%delitem(@itemtodel,@listokills);#show INCREMENTING @itemtodel;#math numkills @numkills+1;#var itemtoadd @numkills/@mobname;#show RE-ADDING NEW : @itemtoadd;#var listokills %additem(@itemtoadd,@listokills)} } } };#if 
(@mobnamefound = 0) {#var itemtoadd2 1/@itemtoadd;#show @itemtoadd not found, adding new : @itemtoadd2;#var listokills %additem(@itemtoadd2,@listokills)};#var listkillnum %numwords(@listokills,|);#show End of 
KILLLISTADD;killlist50} {killlist}

4. The killlistshow alias is for your use. It lists what is in the kill buffer list so you can see if you cleared your buffer enough or not. It is never automatically called by anything here, although you can make it automatic if you wish. It is quite spammy.

#ALIAS killlistshow {#show Items in buffer kill list : @listkillnum;#if (@listkillnum > 0) {#show Oldest kills listed first:;#loop 1,@listkillnum {#show Buffer Entry %i : %word(@listokills,%i,|) } }} {killlist}

5. The killlist50 keeps the list clean of items older than 50 unique kills ago. The oldest entry is dropped if there are more than 50 entries on the list.

#ALIAS killlist50 {#var listkillnum %numwords(@listokills,|);#if (@listkillnum > 50) {#var itemtodel %word(@listokills,1,|);#show CLEARING @itemtodel OFF OF KILLLIST;#var listokills %delitem(@itemtodel,@listokills)};#var 
listkillnum %numwords(@listokills,|);#noop keep list down to 50 items, removing oldest item} {killlist}

6. The killlistfind alias takes one parameter and looks through the kill list entries to see how many matches it finds. For example, if you enter "killlistfind a" then every entry that contains the letter "a" will be echoed to the screen. On a more practical side, if you are waiting for that dragon to scroll off, you can enter "killlistfind dragon" and see what position he is in. I added this alias because it is easier to use this than killlistshow if you are looking for a specific mob in your kill buffer. It's easier than looking through 50 lines of kills that don't have any spaces in them!

#ALIAS killlistfind {#show Items in buffer kill list : @listkillnum;#if (@listkillnum > 0) {#show Oldest kills listed first:;#loop 1,@listkillnum {#if (%pos(%1,%word(@listokills,%i,|)) > 0) {#show Buffer Entry %i : 
%word(@listokills,%i,|)} } }} {killlist}

7. The killlistfile alias doesn't take any parameters. It writes your current kill list to a file named for the date plus "kb.txt" for kill buffer. So if the date is 01 Jan 01 then the filename is 010101kb.txt for output. Note the

#var playername variable. This playername is written to the file right before the kill list so that when you go looking at the text file you will know the time, date, and player whose kill buffer you are looking at.
#ALIAS killlistfile {#show Items in buffer kill list : @listkillnum;#var playername Zistrosk;#var now %time(ddmmmyy|hh:mm:ss);#var namett %concat(@curdate,"kb.txt");#file 2 @namett;#write 2 @now-@playername Kill Buffer ~(oldest 
kills listed first~):;#if (@listkillnum > 0) {#loop 1,@listkillnum {#write 2 Buffer Entry %i : %word(@listokills,%i,|) } };#close 2} {killlist}

Notes: The list is a text variable with entries separated by the pipe "|" symbol. Each entry is composed of two parts, a number of kills and a mobname. The number of kills and the mobname are separated by a slash. The following killlist is an example:

1/Aspoiledbrat|11/TheWhiteDragon|2Acutebunny

This example reads as follows: Most recently, you killed 2 mobs named "A cute bunny". Next recently, you killed "The White Dragon" 11 times. And your oldest recorded kill is 1 kill of "A spoiled brat".

Please let me know if you have any problems with this set. Please feel free to add, remove, or otherwise modify these as you see fit.

Below, in case you are wondering, is a good example of what a good clear buffer really does look like. This is direct output from the "killlistshow" alias:

Items in buffer kill list : 50
Oldest kills listed first:
Buffer Entry 1 : 1/Adustyskeleton
Buffer Entry 2 : 1/Therottingzombie
Buffer Entry 3 : 1/Anagedalchemist
Buffer Entry 4 : 1/Adustyhaze
Buffer Entry 5 : 1/ARainbowCultwarrior
Buffer Entry 6 : 1/Awitheredmagician
Buffer Entry 7 : 1/AnIllusionist
Buffer Entry 8 : 1/Amudcreature
Buffer Entry 9 : 1/Anicecrystal
Buffer Entry 10 : 1/TheHurricane
Buffer Entry 11 : 1/TheMagneto
Buffer Entry 12 : 1/Amediumelemental
Buffer Entry 13 : 1/Atinyelemental
Buffer Entry 14 : 1/Asmallelemental
Buffer Entry 15 : 1/Alightningspark
Buffer Entry 16 : 1/Alittleimp
Buffer Entry 17 : 1/TheBlueFlame
Buffer Entry 18 : 1/Anelementaleddie
Buffer Entry 19 : 1/Anelementalmist
Buffer Entry 20 : 1/Anacidblob
Buffer Entry 21 : 1/Abeastoflava
Buffer Entry 22 : 1/Anelementalpuddle
Buffer Entry 23 : 1/Apebble
Buffer Entry 24 : 1/Aparticleofenergy
Buffer Entry 25 : 1/Asmolderingflame
Buffer Entry 26 : 1/Anolddoll
Buffer Entry 27 : 1/Adwarvenyouth
Buffer Entry 28 : 1/Themeanoldnanny
Buffer Entry 29 : 1/Adwarvenchild
Buffer Entry 30 : 1/Adwarventoddler
Buffer Entry 31 : 1/Anuglystuffedbear
Buffer Entry 32 : 1/Aknavishbully
Buffer Entry 33 : 1/Aspoiledbrat
Buffer Entry 34 : 1/Acollie
Buffer Entry 35 : 1/Thefatcook
Buffer Entry 36 : 1/Aservantboy
Buffer Entry 37 : 1/Ahouseservant
Buffer Entry 38 : 1/Astablehand
Buffer Entry 39 : 1/Aridinghorse
Buffer Entry 40 : 1/MasterTullfuhrzky
Buffer Entry 41 : 1/LadyTullfuhrzky
Buffer Entry 42 : 1/Robert
Buffer Entry 43 : 1/Asmallchild
Buffer Entry 44 : 1/Adecrepitoldnanny
Buffer Entry 45 : 1/Arat
Buffer Entry 46 : 1/Agiantrat
Buffer Entry 47 : 1/Agnomechild
Buffer Entry 48 : 1/Theteacher
Buffer Entry 49 : 1/Thereceptionist
Buffer Entry 50 : 1/Thechiefgnome

SCRIPT

#TRIGGER {(%w) is DEAD!!} {#var linebefore1 %line2;#var fullmobname %replace(%left(%trigger,%pos(" is",%trigger))," ","");#show MOB : @fullmobname JUST DIED;#show LINE1BEFOREKILL : @linebefore1;#var killedit 
%word(@linebefore1,1);#if (%pos("You",@killedit) > 0) {#show YOU GOT THE KILL;killlistadd @fullmobname};#if (@look = 0) {look;#var look 1};save;#noop fullmobname = left portion of string before " is DEAD!" with spaces 
removed;#noop if you have "a young turtle is DEAD!" then fullmobname = "ayoungturtle"} {+} 5

#ALIAS killlistclear {#var listokills {""};#var listkillnum 0;#show Kill List Emptied.} {killlist}

#ALIAS killlistadd {#var itemtoadd %1;#var numkills {""};#var itemtoadd2 {""};#var mobname {""};#var mobnameandnum {""};#var mobnamefound 0;#var listkillnum %numwords(@listokills,|);#show Scanning list for @itemtoadd;#if 
(@listkillnum > 0) {#loo 1,@listkillnum {#var itemtocheck %i;#math itemtocheck @listkillnum-@itemtocheck;#math itemtocheck @itemtocheck+1;#var itemtodel %word(@listokills,%i,|);#var listkillnum %numwords(@listokills,|);#var 
numkills %word(@itemtodel,1,/);#var mobname %word(@itemtodel,2,/);#if (@mobnamefound = 0) {#if (@mobname = @itemtoadd) {#show Found @itemtoadd;#var mobnamefound 1;#show REMOVING : @itemtodel;#var listokills 
%delitem(@itemtodel,@listokills);#show INCREMENTING @itemtodel;#math numkills @numkills+1;#var itemtoadd @numkills/@mobname;#show RE-ADDING NEW : @itemtoadd;#var listokills %additem(@itemtoadd,@listokills)} } } };#if 
(@mobnamefound = 0) {#var itemtoadd2 1/@itemtoadd;#show @itemtoadd not found, adding new : @itemtoadd2;#var listokills %additem(@itemtoadd2,@listokills)};#var listkillnum %numwords(@listokills,|);#show End of 
KILLLISTADD;killlist50} {killlist}

#ALIAS killlistshow {#show Items in buffer kill list : @listkillnum;#if (@listkillnum > 0) {#show Oldest kills listed first:;#loop 1,@listkillnum {#show Buffer Entry %i : %word(@listokills,%i,|) } }} {killlist}

#ALIAS killlist50 {#var listkillnum %numwords(@listokills,|);#if (@listkillnum > 50) {#var itemtodel %word(@listokills,1,|);#show CLEARING @itemtodel OFF OF KILLLIST;#var listokills %delitem(@itemtodel,@listokills)};#var 
listkillnum %numwords(@listokills,|);#noop keep list down to 50 items, removing oldest item} {killlist}

#ALIAS killlistfind {#show Items in buffer kill list : @listkillnum;#if (@listkillnum > 0) {#show Oldest kills listed first:;#loop 1,@listkillnum {#if (%pos(%1,%word(@listokills,%i,|)) > 0) {#show Buffer Entry %i : 
%word(@listokills,%i,|)} } }} {killlist}

#ALIAS killlistfile {#show Items in buffer kill list : @listkillnum;#var playername Zistrosk;#var now %time(ddmmmyy|hh:mm:ss);#var namett %concat(@curdate,"kb.txt");#file 2 @namett;#write 2 @now-@playername Kill Buffer ~(oldest 
kills listed first~):;#if (@listkillnum > 0) {#loop 1,@listkillnum {#write 2 Buffer Entry %i : %word(@listokills,%i,|) } };#close 2} {killlist}


LOG TELLS TO A SEPARATE WINDOW TRIGGER/ALIAS SET

Saving tells, or any other kind of easily triggerable text (i.e. other channels like chat, ask, avatar, etc) is very simple. In this example, there are three settings consisting of two aliases and one trigger.

First, to output text to a separate window, you are going to need that separate window to be created somehow. This first alias, "tellwinon", opens up a new window named "Tells" and sets the @tellwin variable to 1. The "#WIN Tells" command is all that is needed to open the new window, but the variable @tellwin can be used below to determine if text needs to be sent to the window or not. In this example, the @tellwin variable is set to 1 when the window is open and available (because you typed in the tellwinon alias), and set to 0 when the window is not available (because you typed in the tellwinoff alias). Here is the first alias:

#ALIAS tellwinon {#VAR tellwin 1;#WIN Tells} {tellwin}

Second, it would be nice to have a way to stop logging text to the "Tells" window, should you need to. As stated a few lines up, the "tellwinoff" alias takes care of this by setting the @tellwin variable to 0. This does not close the "Tells" window created by the first alias, it just sets a variable that is used in the trigger below to determine if text should be sent to the "Tells" window. To close the "Tells" window you have to click the close button on it (the X in the upper right hand corner of the "Tells" window, just like any window) and close it yourself. Here is the second alias:

#ALIAS tellwinoff {#VAR tellwin 0} {tellwin}

Third, you need a way to capture the tell channel and send the text from it to the "Tells" window. This trigger does the trick. First, it triggers off of the pattern "(%w) tells you '", so that it only goes off when a tell comes across your screen. Second, it takes the entire line that caused the trigger to go off, and copies it into a variable named @lasttrig using the system variable %trigger. Next, it sets the variable @now to the current date and time stamp from your system clock. An example of @now would be "31Jan00|20:00:00", meaning the date of 31 January 2000 at 8:00:00pm. The timestamp isn't absolutely necessary, but wouldn't it be nice if you knew how long ago someone sent you that tell? That is why it was included here. The next thing the trigger does is checks the @tellwin variable to see if it is equal to 1. If it is equal to 1 then the command ":Tells:@now-@lasttrig" is executed, sending the timestamp followed by the text of the tell to the "Tells" window. If @tellwin is equal to 0 (or anything besides 1) then no command is executed by the #IF, and the trigger ends without sending any text to the "Tells" window. Here is the trigger:

#TRIGGER {(%w) tells you '} {#var lasttrig %trigger;#var now %time(ddmmmyy|hh:mm:ss);#if (@tellwin = 1) {:Tells:@now-@lasttrig} } {tellwin}

By adding the @now variable, the trigger's output to the "Tells" window looks similar to this example:

Tells Window Sample


NOTES :

- The :Tells: syntax is used because it does not cause a "focus switch". In other words, the Tells window could be minimized, and the :Tells: command could go off, and you'd never know it because you wouldn't see the change until you maximized the Tells window and made it visible again. The alternate syntax for this command would be "#WIN Tells @now-@lasttrig". If the trigger used this command then you would find that the active window would switch to "Tells" whenever a tell came in. Here are reasons to avoid this : focus switching switches you from your character to the Tells window and you can't type in any commands until you click on your character window again, focus switching causes zMud to come to the front -- something you may not want if you are in another program and wished to let zMud run in the background without interrupting you. Reasons to have this active : you are waiting for an important tell from an IMM or a good friend and you want to make sure that you see it no matter what program you are in or which character you are on. Mostly, #WIN is an annoying syntax to use, but sometimes has it's uses.

- The @now variable, and the %time syntax used are optional and can be removed or changed any way you want them to be. Look up the %time function in the zMud programming guide for more info on how else it can be coded. This particular syntax was used because it produces the exact same-length date/timestamp every time, which is great for sorting on.



Source: Zistrosk's zMud Page – Information from way back when...