zMUD Tips

Okay, so you read my New Moon Tips webpage and you're ready for more, huh? Or maybe you don't play New Moon at all but you want to learn how to program zMUD? Maybe you don't even know what this zMUD is, but you're curious? Well, you've come to the right place!

Intro to zMUD

Questions and answers of what I imagine might be common topics to an uninitiated person.

Q. Alright, what is zMUD?
A. It's a mud client, used to connect to MUD's and interact with them. You probably know about MUDs, don't you?
Q. Where can I get it?
A. From http://www.zuggsoft.com
Q. How much does it cost?
A. That depends on how old and unsupported you're willing to put up with:
Version 5.55 Costs US $20 but has a 30 day trial evaluation period. Does not work with Windows 3.x
Version 4.62 Costs US $20, has a 30 day trial evaluation period, but is unsupported. Works under Windows 3.x and includes the old automapper.
Version 3.62 Free, unsupported, and has no automapper. Works with Windows 3.x
Q. Which version do you use?
A. I use version 3.62 (the free one), though I'm seriously considering buying the newest version because I want to try out the new programming options it provides!
Q. What can I do with it?
A. Whoah, nellie! Hold off until the next section!

The Next Section: Introduction to Programming zMUD

I'll leave the basics of using zMUD to the provided documentation and online info. This section is all about what you can do with this baby once you get it out of the box. This discussion will use New Moon as a specific example, but the techniques will work with most any MUD.

There are three fundamental capabilities you'll need in order to program zMUD effectively: aliases, variables, and triggers. These are the heart and soul of zMUD programming. Well, they're the muscles, brains, and sensory organs of it actually. Here's what they are:

Aliases

An alias is a user-defined function. You can define it by giving it a name and a list of commands to execute whenever you type in the name at the beginning of a line in zMUD. To set up an alias from the command line, just enter

#ALIAS aliasName {command you want to be executed whenever you type aliasName}

You can use extra parameters for aliases also. For a trivial example, suppose we wanted to recreate the MUD alias for "kill" but do it in zMUD instead. We would enter

#ALIAS k kill

Thus, typing

k goblins

would result in the command

kill goblins

being passed to the mud.

Variables

A variable is a piece of memory which stores some value for you until you need to use it later. You assign them a value by using the #VAR command, such as

#VAR level 100
or
#VAR coolName MIzerAI

You can find out what the value of the variable is by just

#VAR level
(which if you're following along, will spit out that level has value of 100).

To actually use these values, you precede the variable name with the @ character. For example, if you issued the command

say I made it to level @level

you would send the following command to the mud:

say I made it to level 100

Triggers

A trigger matches a pattern in the text coming in from the mud and does something in response to it. Many MUDs (New Moon included) discourage the use of triggers for automating the actions of a character. However, you can use triggers for many other things to make your mudding experience more enjoyable and make it easier to keep track of things that are going on in the MUD.

At the command line, you can create a trigger as follows:

#TRIGGER {testpattern} 'command to execute on trigger' triggerClass

For a nice GUI interface for setting up your triggers, as well as advanced trigger features, you'll have to go to the Triggers Preferences dialog. It lets you set up classes of triggers which can be turned on/off as a group, too.

Examples of Programming zMUD

I use zMUD to keep track of several parameters of my character. Things like hit points and guild points which vary wildly and are very important to your success in the game. In my New Moon Tips page I describe the prompt and monitor commands I use to show this pertinent information. Now I'll tell you how to go one step up and put this information on your zMUD status bar!

Displaying hp and gp in the status bar

The status bar in zMUD lives just above the text entry box at the bottom of the window. Right-click it and you'll see that status bar definition window. It is in here that you can tell zMUD what to put in your status bar and status window. Oh yeah, the status window can be displayed by selecting "Status" from the Window menu.

We're going to set up variables for holding our current hit points and our current guild points. This is as easy as entering the two lines:

#VAR hp 0
#VAR gp 0

Next, we'll need to figure out at what values to set these. That's where the prompt and monitor tips come in! We'll make a trigger to match the prompt, extracting the relevant values from it, and then use those values to set our variables. Since my main character is a thief, and thief gp's are named Slyness, I'm going to be using that for all the examples.

The trigger we want to make is:

#TRIGGER {Hp: (%d) * Slyness: (%d)} '#VAR hp %1\#VAR gp %2'

Finally, we'll need to show these values in the status bar (and/or window). To do this, right-click on the status bar (or window) and a dialog box pops up with a line of text you can edit for your status bar, and a box of text you can edit for your status window. Enter into the status bar line the following string:

Hp: @hp Gp: @gp

And now we're ready to log on and test our code! Now, with the prompt giving you this info all the time, you might wonder what use it is to display this at the bottom of the screen in the status bar. Well, suppose you want to see how many hp/gp you had last, but the previous prompt has already scrolled off the screen, and your hands are all covered with chicken fat you pulled out of the dog (or something). Look no farther than that status bar!

...to be continued...

go back to my New Moon page

Disclaimer: This is a site under eternal construction, as are most Internet websites.