Aliases are wonderful, but you must be careful. There may be things that you can do with aliases that are against the rules of the MUD. There may be things that you can do with aliases that break the MUD. There are things you can do with aliases that will irritate, annoy, or infuriate creators. Infuriating creators will not enhance your mudding. You have been warned.
These are examples of aliases I have that you might find useful. Maelin wrote a useful tutorial on aliases for the MUD. I suggest you look at the on-line help. Note that all aliases should be input on a single line.
Arguments are used in aliases with the following translations:
Each word is a seperate argument. This can be shown with the following example:
alias testalias frimble all: $*$;frimble first: $1$;frimble second: $2$;frimble third: $3$;frimble second plus: $2*$;
> testalias this is a test
all: this is a test
first: this
second: is
third: a
second plus: is a test
There are several methods of executing based on the presence of an argument. However, it is not possible to test the content / value of an argument.
Simple argument substitution with default value:
alias mytest1 frimble $arg:there were no args$
> mytest1 this is a test
this is a test
> mytest1
there were no args
A more practical use for this:
alias heal hold oak wand;zap $arg:me$ with oak wand;
Conditional execution:
alias lrn teach $ifarg2: $2$ levels of $endif$ $1$ to me;learn $1$ from me;
This can then be used as follows:
lrn fi.co.me.bl
lrn ot.mo.sw 5
This is useful to teach yourself skills. If you normally learn skills from Lanfear:
alias lrnfrm teach me $ifarg3: $3$ levels of $endif$ $1$ from $arg2:lanfear$;learn $1$ from $arg2:lanfear$;
Using special attacks? Try these:
alias bop bash $*$ with weapon;
alias sap smash $*$ with weapon;
and you can bop or sap your opponents provided you are holdong a weapon that supports these combat specials!
Taking these further:
alias ks kill $*$;feint at $*$ with weapon;smash $*$ with weapon;
When you've killed something, you need to get all those valuable and useful bits from the corpse.
alias crps get jewellery & coins & torches & silk robes from $arg:corpses$;open hunter's pack;put torches & silk robes in hunter's pack;put jewellery in coat;close hunter's pack;bury $arg:corpses$;
If you're trying to delude a weapon, and don't want to go through that show my weapon to everyone at the drum / BI / Tuna Walk / Bazaar stuff, try this:
alias ks kill $*$;smash[stab,slice,crush,behead...] $*$ with deluded_name;
You can also help this along with a through other subtle changes, such as adding:
look deluded_name;condition deluded_name;
onto the corpses alias above.
Before you go in:
alias inlib alias l left;alias r right;alias b backward;alias f forward;
and you can now use l, r, f and b. You must use look though, and be careful of using l instead of look and walking into a distortion.
After you come out:
alias outlib unalias l;unalias r;unalias f;unalias b;alias f follow $*$;
Where amc is an abbreviation for a channel called ankh-morporkcouncil:
amc: $ifarg:ankh-morporkcouncil $*$$else$talker list ankhmorporkcouncil$endif$;
so that amc gives a list of those using the channel, amc sometext sends sometext to the channel as talker chat or a command.
alias ipk $ifarg:open pack;put $*$ in pack;$endif$close pack;
alias opk open pack;$ifarg:get $*$ from pack;close pack;$endif$
alias ibt put $*$ in belt;
alias obt get $*$ from belt;
alias comp identify $*$ as component;
alias pac put every component in component pouch;
and, for those that keep their packs open:
alias gf get $*$ from pack;
alias gh get $*$ from pack;hold $*$;
alias gw get $*$ from pack;wear $*$;
Got a crystal ball? Keep it in a pack? Try this:
alias scri opk crystal ball;scry $*$ with crystal ball;rub crystal ball;ipk crystal ball;
Note that if you also have balls of sap or juggling balls in the pack, you must use "crystal ball", unless you identify or delude it.
alias s1 c sfp $arg:me$;ipk shield;
alias s2 c tpa $arg:me$;ipk shield;
alias s3 c ccc $arg:me$;
alias s4 c eff tsortean metal shield;
and you can shield yourself easier during combat.
I keep a chain in the Ohulan Cutash vault. This alias assumes that I can carry my shield. It knocks it down, pick it up, walk to the smithy, fix it and refloat it.
alias floatfix get chain from hole;c ffod me;get chain;put chain in hole;get shield;w;w;s;s;s;e;e;s;fix shield;s4;
Be careful when using this:
alias 5times $*$;$*$;$*$;$*$;$*$;
If you call it like this:
5times 5times say hello
You will get error messages like: "Recursive aliases. Bad boy/girl." However, you can:
alias 5times $*$;$*$;$*$;$*$;$*$;
alias 3times $*$;$*$;$*$;
alias 15times 5times 3times $*$;
15times say hello
to get 15 "Say Hello"s.
Restore all jewellery, worn & in multiple containers, assumes none is being carried:
alias jfix open all & all in all;remove jewellery;restore jewellery & jewellery in all & jewellery in all in all;wear jewellery;close all;
The "& jewellery in all ........" can be extended to handle further levels of nesting. This requires the "andascomma" option to be enabled!