Better Shading through triggers

or

How I learned to kill the guard, king the T, and still have time for a cup of coffee.

 (A discussion of the implementation of auto-response triggers using zMud v5.22)







This article is intended to provide a level starting point for any Shadist who is interested in simplifying their game-play. Many of our existing players take advantage of the rich facilities provided by scripting software such as zMud, and the following discussion is intended to provide a level starting point for any others interested in this technology.
 
 

zMud

A software application that may be used instead of a telnet session under Windows 95/NT when connecting to a text based multiplayer game. Written by Michael Potter, not only can zMud be used to take the drudgery out of certain mundane tasks (why type put shoe fountain when you can use pf shoe and have the software expand this for you), but it may also be used to automatically respond to certain text on-screen (Youve just been attacked by the bear or another player? Why not have the software automatic ally retaliate with your best weapon whenever it receives (anytext) has just attacked you).
 
 

It is possible to abuse the power of such software and write scripts that will automatically clear a game of treasure, or attack other players even when unattended, but ultimately these do not enhance the game either for the script user, or other players. My aim with the following tips is to introduce you to the basics of defence and typing-reduction by using zMud.
 
 

Step 1. Obtain the relevant software. These tips work under zMud version 5.22, but may require tweaking in earlier versions due to bugs or unsupported features. zMud is available from http://www.zuggsoft.com/zuggsoft/index.cfm
 
 

Step 2. Scan the help files, and read the articles in the zMud discussion forum on www.zuggsoft.com
 
 

Step 3. If you really dont want to start implementing your own scripts, then try playing with the following settings. Be warned, if you play a persona that is important to you without first testing these scripts, then you may well receive some nasty surprises.
 
 

Triggers and Variables
 
 

This introduction to triggers, variables and aliases is exactly that - an introduction. The help files supplied with zMud will provide an in depth guide to configuring your scripts.
 
 

The major strengths of zMud are the ability to respond to a specific pattern of text and the ability to assign a value to a variable, and then use that variable in multiple locations. Allow me to give you an example
 
 

If you are attacked by a mobile, the syntax on-screen will always be:
 
 

You are attacked by the <mobilename>
 
 

It is therefore very simple to set up a trigger that will send the text retaliate with longsword in response. The beauty of this is that if you happen to be away from the screen when attacked, the trigger will automatically use the assigned weapon and cause your character to fight back. To generate this trigger, you can either use the user interface to enter the text, or enter the following line at the zMud command prompt:
 
 

#trigger {You are attacked by the} {retaliate with longsword} fight
 
 

Breaking this line down
 
 

#trigger

Indicates to zMud that the following line is to be added to the trigger list
 
 

{you are attacked by}

The first argument is the pattern that zMud looks for in the text received from the MUG
 
 

{retaliate with longsword}

The second argument is the text that zMud will transmit back to the MUG in response.
 
 

Fight

The third argument is the class that the trigger is assigned to. By using multiple classes within zMUD it is possible to enable and disable a range of triggers with one command (see T+ in the zMud help files).
 
 

so where do variables come into this? Well, if you play a game, you are unlikely to just happen to have the longsword on you, and so you need to set up a variable to handle the weapon name. A better solution might therefore be something like the following.
 
 

#VAR WEP ""
 
 

#VAR

Advises zMud that the following text is to be set up as a variable.
 
 

WEP

Field one is the name assigned to the variable. It is logical to assign a name that relates to the intended content of the variable - i.e. the variable that will contain your current weapon might be called (as in this example) WEP.
 
 

""

The text that you want to initialise the variable with. In this case I have set it to Null (two quotation marks). The variable therefore now exists, but contains no text.
 
 

#trigger {You are attacked by the} {retaliate with @WEP} fight
 
 

The only change here to the original version is that the item longsword has been replaced with the variable WEP (as you will notice, when referring to a variable, zMud is advised that you mean a variable rather than a similar piece of text by prefixing the variable with an @).
 
 

WEP=longsword
 
 

and an improved version of our trigger is now complete. Whenever you now receive the text You are attacked by your software will automatically retaliate with your currently assigned weapon. One final tweak that we will include at this time is to include the ^ symbol at the beginning of the attack pattern. This indicates to zMud that we are only interested in matching text that we receive from the game, where You are attacked by the is at the beginning of the line. Therefore:
 
 

Jill says "You are attacked by the bear" Would not be matched.
 
 

but
 
 

You are attacked by the bear Would match and trigger the response.
 
 

Now this trigger will work fine against all mobiles, but when another player attacks you, the text that advises you of the attack is quite different. To cater for this you should create a second trigger that differs only in the pattern of text which cause the trigger to activate:
 
 

As you can see, the trigger uses the same WEP variable to respond, but is triggered by a different block of text. We again use the ^ symbol to advise zMud that we are only interested in this pattern if it starts at the beginning of the line (as opposed to our already used example of someone saying the text to you), but you will notice that we now have a (%w) at the start of the pattern. This group of characters indicates that any ONE word may be in this position and the text will still match. Therefore:< /P>
 
 

Mary attacks you with
 
 

and
 
 

Jill attacks you with
 
 

would both match, despite the first word being different. If there were multiple words in that position (such as Mary the Explorer and Jill the Sorceress) we would use (*) instead of the (%w), to indicate any number of words (one or more) followed by attacks you with.
 
 

Summary:
 
 

Set up your variables first:
 
 

To set up the variable for both triggers (you need do this only once, and then save your variables) To update the variable whenever a new weapon is picked up Create your triggers:
 
  Against mobiles To cater for player attacks To check what weapon you currently have selected, type: Aliases (reducing the need for nimble fingers)
 
 

Whether it be speeding up your treasure collecting, or reducing the number of keys you need to press during a fight, aliases are a simple way of helping you type the right thing quickly.
 
 

An example of this is when touching the girl to regain your stamina. Why type touch girl several times a game (assuming that you havent automated this with a trigger (hint, hint)) when you could set up a simple alias and then just use tg to perform the same act. When doing the dash for treasure, a half second saved here and there can add up to you reaching that vital key, or juicy jewel a fraction of a second before your fellow collectors, as opposed to a fraction of a second after - not to mention that typing unlock brass key may sometimes be unbelievably difficult after a night out on the town - ubk becomes far more attractive under such circumstances.
 
 

As with the triggers, you may add aliases either through the zMud menus, or from the command line. For the command line you must use the #alias function, and two examples follow:
 
 

Following the creation of these aliases, simply type tg or ubk to perform the relevant action.
 
 

Conclusion
 
 

These simple customisations are just a taste of the fun you can have with zMud (or any other scripting software). For more information, read the excellent help files that come with the software, and keep abreast of the postings on the zMud home page discussion forum. If you want try customising your settings further, then why not consider the following challenges:

 Whilst I am more than happy to help you, I strongly recommend that you investigate the help files first for assistance. Failing that, just find me online.
 
 

Enjoy

 Ravena