Alias: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Bale
m fix case
imported>PhilmASTErpLus
Expanded general how-to on aliases.
Line 1: Line 1:
{{DISPLAYTITLE:alias}}
{{DISPLAYTITLE:alias}}
An alias is a shortcut in the CLI, set by users. For example, a simple alias is mapping the CLI function "familiar" to the function "f", as a shortcut. To remove an alias you need to use the unalias command.
Creates a new alias in the KoLmafia CLI or displays the list of registered aliases.
An alias is a shortcut for complex CLI command(s) that are too long to type every time you want to. To create a new alias, type
alias ''[alias_name]'' => ''[actual_command]''
into the CLI, where <code>''[alias_name]''</code> and <code>''[alias_command]''</code> are replaced with the shortcut string you want to use and the actual command string. For example, to create an alias "f" for the <code>[[familiar]]</code> CLI command, type:
<pre>alias f => familiar</pre>
Now, instead of typing <code>familiar pixie</code> or <code>familiar sandworm</code>, you can just type <code>f pixie</code> or <code>f sandworm</code>.


==Simple Example==
To see the list of aliases that you have created so far, type <code>alias</code> into the CLI without any arguments.


<p><pre>alias f => familiar</pre></p>
Aliases are preserved across multiple characters. You can remove existing aliases by using the <code>[[unalias]]</code> command.
Now, instead of typing ''familiar pixie'' or ''familiar sandworm'', you can just type ''f pixie'' or ''f sandworm''.


==Complex Example==
== Complex Examples ==


<p><pre>alias dentures => checkpoint; equip frilly skirt; ash visit_url("inv_use.php?which=3&whichitem=2951&pwd");
<pre>alias dentures => checkpoint; equip frilly skirt; ash visit_url("inv_use.php?which=3&whichitem=2951&pwd"); visit_url("choice.php?whichchoice=188&option=3&choiceform3=Catburgle&pwd"); cli_execute("outfit checkpoint");</pre>
visit_url("choice.php?whichchoice=188&option=3&choiceform3=Catburgle&pwd"); cli_execute("outfit checkpoint");</pre></p>


This equips a frilly skirt, chooses the right choice in the Orcish Frat House Blueprints adventure, and then re-equips whatever pants you had on when you type ''dentures'' into the CLI.
This equips a frilly skirt, chooses the right choice in the Orcish Frat House Blueprints adventure, and then re-equips whatever pants you had on when you type ''dentures'' into the CLI.


[[Category:CLI Commands]]
[[Category:CLI Commands]]

Revision as of 20:32, 16 September 2010

Creates a new alias in the KoLmafia CLI or displays the list of registered aliases. An alias is a shortcut for complex CLI command(s) that are too long to type every time you want to. To create a new alias, type

alias [alias_name] => [actual_command]

into the CLI, where [alias_name] and [alias_command] are replaced with the shortcut string you want to use and the actual command string. For example, to create an alias "f" for the familiar CLI command, type:

alias f => familiar

Now, instead of typing familiar pixie or familiar sandworm, you can just type f pixie or f sandworm.

To see the list of aliases that you have created so far, type alias into the CLI without any arguments.

Aliases are preserved across multiple characters. You can remove existing aliases by using the unalias command.

Complex Examples

alias dentures => checkpoint; equip frilly skirt; ash visit_url("inv_use.php?which=3&whichitem=2951&pwd"); visit_url("choice.php?whichchoice=188&option=3&choiceform3=Catburgle&pwd"); cli_execute("outfit checkpoint");

This equips a frilly skirt, chooses the right choice in the Orcish Frat House Blueprints adventure, and then re-equips whatever pants you had on when you type dentures into the CLI.