Quick Overview

zMUD is an application through which you can connect to and play online MU* games like Avatar, not unlike Telnet or Hyperterminal. What makes zMUD very different from those other applications, however, is that it also provides players with an interface that can enhance your capabilities as a player.

zMUD allows you to create, manipulate, and store scripts that react to the game, such as automatically restoring heighten when it falls or changing you into leveling gear when you're close to leveling. As a quick overview, a few of the more commonly used Zmud features include:

TypeCommandSyntax following Command
ALIASES#ALIAS or #ALaliasname {command}
CONDITIONALS#IF(condition to be met as true) {command if true} {optional command if false}
TRIGGERS#TRIGGER or #TR{pattern} {command} triggerclass
VARIABLES#VARIABLE or #VAR{variablename} {value}

Aliases in zMUD function similarly to those in the game. But unlike aliases in the game, all entries need not be valid Avatar commands. This allows you to create more complex aliases, as well as using variables and toggling triggers.

Triggers, variables, and conditionals are arguably the most useful tools zMUD provides. Triggers entail matching the patterns you command zMUD to expect with the mud text that appears on your screen; once a match is made, the command is executed. Conditionals and variables allow for greater control over commands and functions.

For more information, you can read the help files at Zuggsoft.

Introduction to Triggers

Because triggers allow zMUD to react instantaneously to events happening in the game, they can be put to many uses, and therefore comprise the greater portion of the functions listed on this website. Triggers are also a bit more complicated than they might first appear. As a basic example, you might be tempted to create a grouping trigger in the following format:

#TRIGGER {(%w) now follows you.} {group %1}

This trigger would work, but it's not a good one. If you know the game, you know what would happen if anyone were to chat or an IMM echo:

Me now follows you.

To prevent abuse and inappropriate triggering and make certain your triggers match whenever they should, you will want to refine match patterns through wildcards and other special characters, which are listed on Triggers 101. Returning to the example, a much improved version would be:


I added the triggerclass name of autorescue because you will see this trigger again under the Rescue triggers section.

This site will provide triggers and scripts. Clicking the    button under each textbox will automatically highlight the text so you can click on Edit then Copy on your browser menu or Ctrl-C to copy it. In IE, it will also automatically copy the text to your clipboard so you can simply Ctrl-V to paste it into your zMUD or text editor. zMUD will add its own separator character (semi-colon (;) being the default) between lines where appropriate so you should be able to paste in multiple lines from the textboxes and have the commands enter properly, as long as there isn't an equals sign (=) in the script. One notable nuisance about zMUD is that equals signs will act like the enter key.

Disclaimer

You should be aware that depending on the version of zMUD you use, the command syntaxes may occasionally vary slightly from what's listed here. Please don't ask me how to adapt the scripts to your particular zMUD version because I won't know.

Pattern Matching

Every trigger is comprised of a pattern and commands. Patterns consist of hard-coded text and wildcards. In order to make triggers work everytime, you need to first understand how to make your client match the pattern in your triggers with every possible permutation of the desired line of text.

PATTERN MATCHING PRIMER

WildcardMatches

PATTERN MATCHING FINAL

If you're new to zMUD scripting syntax, you might also want to take a closer look at an example.

These lines are only supposed to match the first line of information you see for each person when you type group, but as you know if you've played the game at multiple levels, this line has almost no consistencies in terms of spacing, which can make it tricky to match for variables:

[ 12 War ] LowbieExample 175/ 175 hp 105/ 105 mana 173/ 173 mv
[254 Hero] HeroExample 2918/ 2918 hp 208/ 208 mana 1482/ 1482 mv
[ 5 Lord] AndLordExample 24780/24780 hp 8673/ 9170 mana 17581/17666 mv

To match all three lines, the trigger pattern has to take into account all the spacing inconsistencies:

~[([0-9 ]) (%w)*~] (%w)%s(%d)[/ ](%d) hp%s(%d)[/ ](%d) mana%s(%d)[/ ](%d) mv

This pattern delineates 9 variables:

%1 : Level number
%2 : Lord, Hero, or Class info
%3 : Character name
%4 : Current hp
%5 : Max hp
%6 : Current mana
%7 : Max mana
%8 : Current moves
%9 : Max moves

To read the first variable properly, use either the %trimleft(%1) function for a literal value or the function %eval(%1) to convert the string to a number.

XP Counter Triggers & Aliases

A counter is simply a variable that tracks the number of times something happens; you can use counters to track any event that occurs in the game, whether it be the experience or gold you earn during a run, or the number of times you hit at a certain strength (e.g. devastating, mutilating, etc).

Counters are very easy to create in zMUD. That's because zMUD offers a function that allows you to increment counts in one step: #ADD. The full syntax is simply #ADD variablename amount, which you would call with a trigger.

Every counter is essentially comprised of 4 basic elements:

  1. a variable to keep track of the count,
  2. one or more triggers to increment the count (the trigger will fire the #ADD command),
  3. an alias to report the count, and
  4. an alias to reset the count.

Let's use a basic example: a no-frills experience counter. If all you wanted to track was the number of experience points you gained on a run, all you would need to do is:

  1. Declare an initial variable:
  2. #VAR exp 0
  3. Trigger the count to increase when the appropriate line scrolls onto your screen:
  4. #TRIGGER {^You receive (%d) experience points.} {#ADD exp %1} runcounter
  5. Create an alias that will report the number (since there's no point tracking it if you aren't going to use it):
  6. #ALIAS {runreport} {gtell Total exp: <@exp>}
  7. Make an alias to reset the count to 0:
  8. #ALIAS {runreset} {#VAR exp 0}

That's all you would need. Typing runreport and runreset would report and reset the counter as needed. But as you will see, you can do a lot more with counters.

The following triggers created by Amezyarak (and modified slightly by me) track the experience and numbers of kills, levels, trips, bashes, throws, and rescues you make.


As with the simpler trigger, typing runreset before a run begins will reset all the variables to 0. Typing runreport after the run ends will report the statistics to the group. You can also use runstats by itself to share your bashing, tripping, throwing, and rescue rates.

If you want to calculate additional statistics from any counts that you're tracking (e.g. the average experience worth of the mobs you were killing), another handy command in zMUD is #MATH, which follows the syntax: #MATH variablename expression.

To find the average experience worth of mobs, you could add:

#IF (@cnt>0) {#MATH avg_exp {@exp/@cnt}} {#VAR avg_exp "0"}

The runreport command would then become:


Grouping Triggers & Aliases

Group Counter

These lines will allow you to break down groups and obtain a class count of your group members (which might sound silly in small groups but comes in handy at higher tiers).


Type grpcnter to run the report, but be ready for a bit of spam, since it will run a last on everybody in the group.

Deriving Percentages from Groupstat

Here is a simple trigger that modifies the groupstat line, which normally looks like:

Jane is leading 3 players with 520/535 hp, 241/352 ma, and 648/653 mv.

to include percentage information so it would appear as:

This Group of 3 has 520/535 hp (97%), 241/352 mana (68%), and 648/653 mv (99%).


Affects Triggers

These triggers capture the duration of your spells/affects and display them in zMUD's status window. The information will update the number of ticks remaining each time you type "affects".  
 
awen 12
forti 12
foci 11
invinc 13
iron 13
steel 13
conc 11
bark 10
water 10
   
sanc 5
frenzy --
mv hid --
sneak 8


An example is shown to the right, but you can easily customize the information to suit your own needs. Begin by clicking on the Window menu in zMUD, then selecting Status. Right click in the window that opens and copy/paste the following into the Status Window box:


 

If you want to display any other spells or affects, the format for each line is simply: label @variablename. Just be sure to edit the affreset alias and Spells triggers for each affect you add.

For each variable that you create, set its initial value to -- with the alias affreset and create a trigger that calls upon this alias to reset the values each time.


You will also need to create triggers to capture the relevant information displayed when you type "affects" and store it in variables.


On the zMUD menu, select Actions, then Make Button... in the options (or just Ctrl-B) and enter the following:

Toggle
 
Off Caption:      Variable: 
On Caption:   
On Command:   
Off Command:   

On the Font Settings menu, set the Status Window font to a fixed width style like Courier New or Fixedsys. You may also need to change the colors of the font and background through the Color Preferences menu.

Finally, resize the Status Window to make it as small as possible and position it on a righthand corner of your screen.

Color Triggers

Colors can have a very practical application. Given all the spam that scrolls over your screen, it's sometimes helpful to have certain patterns highlighted. You can change the colors of specific words using #CW or entire lines with #CO. For example, you can highlight the line showing when mobs assist:


Or show others' spell affects more distinctively when you type look in a room:


If you're wondering where the color values came from, click on the Colors button in your zMUD, then choose the Foreground tab. You can change any of those colors by clicking on the swatches and picking a new hue from the spectrum that opens.