Internal Alias System - Midkemia Online Online Help

2.11 Internal Alias System

What is an Alias?
-----------------
An alias is a way to set up a shorthand: something you type that stands 
for something else. If you are always typing CREDITS FOR SALE, for      
example, wouldn't it be easier to just type CFS? Yes, of course it      
would.                                                                  

Here's how to do this:       SETALIAS cfs credits for sale

Every time you type cfs, Midkemia will substitute CREDITS FOR SALE and  
issue that command for you.                                             


Let's say you try this:      SETALIAS sayhi say Hi everyone!
Now when you enter:          sayhi
Everyone will see you say:   Hi everyone!


Targets
-------
Targets are sort of like variables. Think of them as an alias within an 
alias, if that helps! If not, read on. The examples should help. When   
you use a target in an alias, it must have a & at the beginning.        

Let's fix up your alias 'sayhi' a bit. Now it'll say hi to your city    
leader, whoever that may be. (Note the '&' sign below, which means &cl  
is a target.)                                                           

First set it up this way:   SETALIAS sayhi hi &cl
Then define cl:             SETTARGET cl Ishap

Now every time you do:      sayhi
Everyone will see you say:  Hi Ishap

Then if your city leader changes to, say, the new leader Kadiddle,
just change the target:     SETTARGET cl Kadiddle


Combat Targetting
-----------------
Let's say you want to use stl for stormlance. Here's how to accomplish this:
Set up the main alias:      SETALIAS stl cast stormlance &tar
Then define the target:     SETTARGET tar rat
Or change the target:       SETTARGET tar hyena

Every time you want to stormlance something else, just use a new SETTARGET to 
change the value of your target 'tar.'                                  

Make all the aliases you want, and have them all use the same target for
targetting (like &tar, or whatever: just be consistent).                

When you change to a new opponent, simply change the target in this     
manner: SETTARGET tar jackal                                            


Limits on Aliases
-----------------
DON'T make alias names longer than 12 characters.
DON'T put spaces in aliases, though you can put numbers.
DON'T name an alias the same as the command you're replacing.

In other words, don't do this:  SETALIAS cast cast stormlance &tar

If you do this, 'cast' will not work at all!

But you can do this:            SETALIAS stl cast stormlance &t1
And then:                       SETTARGET t1 rat


Problems with Aliases
---------------------
Many problems can come from badly done aliases. If you find that a      
command just stops working for you, check your aliaslist (AL). Maybe you
set up 'eat' or 'smoke' as an alias, then later tried to use the regular
command and it got all messed up.                                       


Advanced Aliases
----------------
There is one more thing about aliases that could be useful.

For setup, try this:         SETALIAS s2 say to
To use it, type this:        s2 juliet Salutations, honoured Juliet!
Which means you'll do this:  say to juliet Salutations, honoured Juliet!

Everything after the alias (in this case, everything after 's2') remains
part of your command. Think of the implications! In fact, that's your   
assignment, gentle reader. Think of all the lovely things you might do  
with that.                                                              


Commands
--------
ALIASLIST                                : Lists your aliases.
AL                                       : same as ALIASLIST.
CLEARALIAS <alias name>                  : Clears an alias.
SETALIAS <alias name> <result>           : Makes a new alias.

CLEARTARGET <target>                     : Clears a target.
SETTARGET <target name> <text>           : Makes a new target.
ST                                       : Same as SETTARGET.
TARGETLIST                               : Lists your targets.
TARLIST                                  : Same as TARGETLIST.


Client Aliases
--------------
If you are looking for help creating MUD Client aliases (or triggers, etc.), see HELP CLIENTS.