Search Help Files


You searched for Alias


1. alias galias command unalias ungalias
For character aliases, use the 'alias' syntax.
Syntax: alias
alias <word>
alias <word> <substitution>
unalias <word>

For account‑wide aliases, use 'galias' syntax.
Syntax: galias
galias <word>
galias <word> <substitution>
ungalias <word>

The alias command allows limited shortening of command names. At this
time, aliases cannot call other aliases, and cannot generate more than one
command. Alias by itself lists your current aliases, Alias <word> lists the
alias with that name (if such exist), and alias with both a word and and
argument produces a new alias. You cannot alias either alias or unalias to
a new command.

The galias command will add an account‑wide alias which may be used on all
characters in your account. If you add the same account‑wide alias as an
alias your character has, it will always choose the character's alias over
the account‑wide one. To remove an account‑wide alias, use 'ungalias
<word>'.

Alias variables are supported. See help alias variables.

Examples of use:

alias gc get all corpse ‑‑> typing gc will equal typing 'get all corpse'

alias ff cast 'fireball' ‑‑> ff orc will equal 'cast 'fireball' orc'

Only the first word on the line will be substituted at this time.


2. alias variables
Alias variables are supported. This allows for creating your own syntax
arrangements for any given command. One command that has a rather
cumbersome syntax is the db command, for example, due to its many different
search variations.

Say you are in search of a level 5 to 10 weapon. The syntax without an
alias would be 'db 5‑10 slot wield'. We could create an alias to simplify
that.

Example: alias dbsearch db $1‑$2 slot $3

There are 3 wildcards, $1, $2, and $3, requiring 3 arguments from the user.
Typing 'dbsearch 5 10 wield' would take $1 and replace it with 5, $2 with
10, and $3 with wield, so essentially it would substitute the string with
'db 5‑10 slot wield'.

It is possible to use a wildcard variable multiple times, such as 'db $1‑$1
slot $2'. If you typed 'dbsearch 5 wield', it would essentially replace
both $1 variables with 5, and $2 with wield.

If you put multiple words in single quotes, it will be treated as one
argument.

The $* variable will grab everything after the alias name entered.

Example: alias testme say 1:[$1] 2:[$2] 3:[$*]

You type: testme hi bye

This shows: You say, '1:hi 2:bye 3:hi bye'

If you want to eliminate usage of single quotes where possible, an example
of that would be an alias like: alias bag put '$*' bag.

Typing 'bag green hat' would put an item with keywords 'green hat' into bag.