Achaea's alias system, including targets and variables - Achaea Online Help

2.10 Achaea's alias system, including targets and variables

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, Achaea 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 House leader,
whoever that may be. (Note the '&' sign below, which means &hl is a target.)

First set it up this way:   SETALIAS sayhi hi &hl
Then define hl:             SETTARGET hl Gawain

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

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


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

Every time you want to maul 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 alias names, though you can put numbers.


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.