Aliases

I don't know about you, but by the time I can type

cast 'magic missile' dragon

it's way too late.  Either I miss an apostrophe or I misspell something, or
the dragon just plain creams me.  Is there an easier way??

The answer is, "yes!"  Aliases make it possible to type in simple commands and
expand them to full commands.  In effect, one could type

mm dragon

and cast a magic missile at the dragon. (It has been my experience, however,
that something more than magic missile might be useful in a dragon encounter.)

Syntax

All aliases are a ONE-WORD command.  Spaces in an alias are not allowed and
will probably mess up the alias commands.  So `mm' is legal, but `m missile'
is not.

Let's start with a simple example; we'll make an alias that gets a bread from
a bag and then makes the character eat the bread.  We'll call it `gbb' for Get
Bread Bag.  Open up an edit session for a connection and click on the
`Aliases' tab.  Create a new parse rule by clicking `New'.  In the `Alias:'
entry field, enter `gbb' without the apostrophes, of course.  Next, in the
commands text area, enter these two lines:

get bread bag
eat bread

Now click on the `Save' button.  Tah-dah!  Now, whenever you type `gbb' in
that connection, it will be interpreted as:

get bread bag
eat bread

Now you will no longer be hungry, but what about thirst?  Easy!  Follow the
steps again, but instead of `gbb' use `dw' for `drink water'.  The commands
will be:

drink water

Easy enough!

Nested aliases

Aliases are allowed to be nested, or put inside of each other.  Let's say we
wanted to have an alias that both ate bread and drank water.  We'll call it
`refresh'.  Make a new alias, using `refresh' as the command name.  For the
commads, type:

gbb
dw

See how we can put already created aliases in the command list?  This makes it
possible to do very complex things with very few commands.

NOTE:
There is the possibility of being caught in an infinite loop.  If an alias
nested in another alias refers to that other alias, and that other alias
refers to the first alias, then the application will keep going and going
when trying to find out what to do.  Example:

(alias name: 
command 1
command 2)

greet: 
nod
welcome

welcome:
say Welcome!
greet

See how greet references welcome and welcome uses greet?  The alias will never
finish, becuase each alias will keep calling another one.

Arguments

To be truly useful, it would be handy if you could pass arguments to the
alias.  Well, you can.  Each command can have an argument number anywhere in
it, preceded with an ampresand (&).  Let's go back to our magic missile
example.  Make a new alias with `mm' as the name, and in the commands type:

cast 'magic missile' &1

The `&1' means "Take the first thing I typed after the command name and put it
here."  So a `mm dragon' will expand to cast 'magic missile' dragon, and that
is why arguments are so darn useful.

There is a special case, `&0' or `&*' which gets replaced with all the text
from the first argument to the end.  I have an "all channels" alias that lets
me say something on all channels.  It is called `ac' and the commands are:

gossip &*
auction &*
;&*
say &*

The `&*' is replaced by whatever I type, making it easy for me to be annoying.

Misc.

Aliases are an easy way to customize commands and make your MUDding experience
more enjoyable.

