Help/Alias

From DikuMUD Wiki
Revision as of 07:11, 21 September 2020 by Papi (talk | contribs) (Created page with "= Alias = There are two alias systems in DikuMUD. The original alias system is built into the dictionary which you can buy in Udgaard and in Midgaard. Look at the dictionary...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Alias

There are two alias systems in DikuMUD. The original alias system is built into the dictionary which you can buy in Udgaard and in Midgaard. Look at the dictionary for help. The old system is for you if you're using telnet only.

This help section is about alias in the web client which built-in alias handling.


Usage:

 alias                   // list your alias
 alias foo               // remove alias foo
 alias foo cmd1 [; cmd2] // create alias foo

No arguments will list all your defined aliases. One argument will remove the alias in question (in this case `foo'). Any other number of arguments will result in the first word of the argument to become an alias for the remainder.

Various special control characters are available in aliases:

You can combine several commands with the semicolon ';'

You can insert various parts of an argument in an alias-text using the dollar sign '$'. $1 will get the first occurrence of the argument, the '$2' the second word etc. The '$0' can be used to substitute the entire argument string.

Examples:

 alias ge get $0 from $1; eat $0;
 alias gb ge bread bag
 alias gs ge steak sack

The alias 'gb' will then mean 'get bread from bag; eat bread' and the commands will be carried out in that order. Alternatively 'gs' will mean 'get steak from sack; eat steak'.

 alias say emote whispers almost inaudibly '$0'

Will make the say command have another appearance for other players, ie: say Hello, friends becomes:

 Gnort whispers almost inaudibly 'Hello, friends'

Notice that 'sa' will still work as the original say-command, as aliases don't check for abbreviations, unlike the command interpreter.

Notice that ANY and all use of ';' and '$' in an alias will be interpreted as that characters special meaning. I.e.:

 alias greet say Hi Quinn $0 God !! ;-)

will substitute the '$0' with whatever argument 'greet' will be given or simply the empty string. Thus the alias 'greet' with no arguments will yield the commands: 'say Hi Quinn God !! ' and because the special character semicolon was used the second command will be '-)', which will give an error message from the interpreter (Unless aliased of course).


See Also:

 {Help Trigger}
 {Help Variable}