Alias: Difference between revisions
imported>Bale Add line-breaks. Should we have a template for this? |
imported>Heeheehee m Added wordwrapping to <pre> tags, added a missing "alias". |
||
Line 13: | Line 13: | ||
== Complex Examples == | == Complex Examples == | ||
=== Automatically Getting Dentures === | === Automatically Getting Dentures === | ||
< | <pre style="white-space:pre-wrap;">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> | ||
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. | ||
=== See How many charges left on Bartender/Chef === | === See How many charges left on Bartender/Chef === | ||
< | <pre style="white-space:pre-wrap;">alias boxen => ashq if(have_chef()) print("Chef turns used: "+get_property("chefTurnsUsed"),"green"); else print("No chef-in-a-box","gray"); if(have_bartender()) print("Bartender turns used: "+get_property("bartenderTurnsUsed"),"green"); else print("No bartender-in-a-box","gray");</pre> | ||
This prints something similar to: | This prints something similar to: | ||
Line 27: | Line 27: | ||
=== See How Many Substats we need to Level === | === See How Many Substats we need to Level === | ||
< | <pre style="white-space:pre-wrap;">alias level => ashq stat s; switch(my_primestat()){case $stat[muscle]:s=$stat[submuscle];break;case $stat[mysticality]:s=$stat[submysticality];break;case $stat[moxie]:s=$stat[submoxie];break;default: } int s_left =(my_level()^2+4)^2 - my_basestat(s);print("Missing "+s_left+" substat for level "+(my_level()+1));</pre> | ||
Prints something similar to: | Prints something similar to: |
Revision as of 17:15, 24 October 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
Automatically Getting Dentures
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.
See How many charges left on Bartender/Chef
alias boxen => ashq if(have_chef()) print("Chef turns used: "+get_property("chefTurnsUsed"),"green"); else print("No chef-in-a-box","gray"); if(have_bartender()) print("Bartender turns used: "+get_property("bartenderTurnsUsed"),"green"); else print("No bartender-in-a-box","gray");
This prints something similar to:
> boxen Chef turns used: 5 Bartender turns used: 10
See How Many Substats we need to Level
alias level => ashq stat s; switch(my_primestat()){case $stat[muscle]:s=$stat[submuscle];break;case $stat[mysticality]:s=$stat[submysticality];break;case $stat[moxie]:s=$stat[submoxie];break;default: } int s_left =(my_level()^2+4)^2 - my_basestat(s);print("Missing "+s_left+" substat for level "+(my_level()+1));
Prints something similar to:
> level Missing 2839 substat for level 12