aliases

What is an alias? What do they do? How would you use them?

I read in a thread a little while back that someone had a piece of script set up as an alias or something like that and was just curious.
 

lostcalpolydude

Developer
Staff member
alias c => counters

Will let you type "c" instead of "counters" to see information about your current counters.

alias hair => buy %% hair spray; use %% hair spray

Will let you type "hair 10" to buy and use 10 hair spray.
 

Spiny

Member
an alias in its simplest form is a way to abbreviate CLI commands or maybe create macros or present ash commands in an easy to use CLI command....

example...
In relay browser chat window, I generally do /fam hobo or /fam stinky or whatever to switch familiars

Sometimes I want to change familiars in mafia, but there is no namespace for "fam", so I have to type out the word familiar which is just cumbersome to me for some reason.

So I set up an alias:
Code:
fam => familiar

Now I can type fam sombrero instead of familiar sombrero in mafia and have it work for me.

A more complicated alias is something Jasonharper posted recently. In KoL's chat window, one can type /examine furry fur and it will pop up a window showing the item decription info. In mafia, you can use the item manager and highlight an item and right click to find out the game description or look the item up in the wiki. You can also type wiki furry fur and the wiki will open up to the page about furry fur. But there was no easy way to see the game description of an item via command line. Jason offered this alias:

Code:
desc => ash int[int] m ; file_to_map("itemdescs.txt", m); cli_execute("text desc_item.php?whichitem=" + m[$item[%%].to_int()])

So now I can type desc furry fur and the CLI will show me the info that the relay browser would show in a popup window for /examine.

-Spiny
 
Wow! That is extremely helpful.:D I've only known how too use them for a matter of minutes now and I already can't figure out how I lived without them!! Thanks for explaining!

If anyone has any aliases that they can't live without please do share. I'm really excited to see what nifty aliases I've been going without.
 
Last edited:

Bale

Minion
well, this cutie will allow me to get cap'n caronchs dentures once I get the Orcish Frat House blueprints. (Assuming I ascended in a muscle zodiac sign... and I nearly always use one of those zodiac signs.)

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");

It will equip a frilly skirt (purchasing one from the knoll if I don't have it), use the blueprints, catburgle the frathouse (using up 3 hot wings), then replace the frilly skirt with my former pants.
 
Last edited:
Nice one Bale! Thanks for sharing.

I've got another question. Can you import scripts with an alias?

alias fl => ash import <functionlib.ash>

this returned:
String successfully aliased.
fl => ash import

Edit: Okay, I checked the gloabal_aliases.txt and it does record the script to import even though the return value when setting the alias doesn't show it. So all is well!
 
Last edited:

kitsunegami

New member
I just upgraded from t7660 (I think) to r7670 and now my MMG aliases suddenly don't work. I tried searching the forums for "mmg bet" but both words are too short so it failed...

Has something changed in the past day to invalidate my aliases (I just used them yesterday)?

The first of these was originally posted by someone else; I just swiped it for my own use since I have no idea how to build/find such urls for myself:

* To bet with meat from my inventory:
mmg => bet.php?pwd&action=makebet&from=0&howmuch=%%party

* To bet with meat from Hagnk's:
mmgh => bet.php?pwd&action=makebet&from=1&howmuch=%%party
 

kitsunegami

New member
alias mmgh => ash visit_url("bet.php?pwd&action=makebet&from=1&howmuch=%%party");
Thanks but holatuwol is putting back the functionality that he removed thus breaking my aliases in the first place. So I'll just leave them as they are and they should work again the next time I upgrade.
 

Alhifar

Member
I figured I'd share one of my favorite aliases I've written, for TP'ing people in large amounts:
alias masstp => ash if( "%%" == "" ) abort( "Usage: masstp [amount] [user]" ) ; int num=substring("%%" ,0,index_of( "%%" , " ")).to_int() ; string player=substring("%% ",index_of("%%"," ")+1);string page ; for i from num downto 1{ page = visit_url( "curse.php? action=use&pwd& whichitem=1923& targetplayer=" + player );if(contains_text( page , "You don't have that item." ) ){ print( "Attacked " + player + " with " + num + " TPs!" );cli_execute("inv refresh"); return 1;}}print("Attacked " + player + " with " + num + " TPs!" );cli_execute("inv refresh" );
 

zarqon

Well-known member
^ an excellent sentence to be saying when someone else just joins a conversation.

Spiny, the "fam => familiar" one was the first alias I ever made! Here's a few more I love:

Code:
disp => ash foreach i in $items[] if (display_amount(i) > 0) print(i+" ("+display_amount(i)+")")

effectref => ash foreach e in $effects[] if(e.to_lower_case().contains_text($string[%%].to_lower_case())) print(e)
famref => ash foreach f in $familiars[] if(f.to_lower_case().contains_text($string[%%].to_lower_case())) print(f)
itemref => ash foreach i in $items[] if(i.to_lower_case().contains_text($string[%%].to_lower_case())) print(to_int(i)+": "+i)
locref => ash foreach l in $locations[] if(l.to_lower_case().contains_text($string[%%].to_lower_case())) print(l)
monsteref => ash foreach m in $monsters[] if(m.to_lower_case().contains_text($string[%%].to_lower_case())) print(m)
skillref => ash foreach s in $skills[] if(s.to_lower_case().contains_text($string[%%].to_lower_case())) print(s)

wheretofind => ash location[monster] locs ; foreach l in $locations[] foreach num,m in get_monsters(l) foreach i in item_drops(m) if (i == to_item("%%")) locs[m] = l; print("The following monsters drop "+to_item("%%")+":"); foreach m in locs print(m+" found in "+locs[m]);
 
pet peeve of mine...

fledges => use 1 mizzenmast mop; use 1 rigging shampoo; use 1 ball polish; conditions add pirate fledges; adv 1 f'c'le

alhifar, that tp alias is awesome!
 

Bale

Minion
Weatherboy, I hate to point this out, but your fledges alias is unnecessary. If you have the mop, the rigging shampoo and the ball polish at the same time, then mafia WILL use them automatically if you adventure at the f'c'le. I guess your alias could be helpful if you sometimes (inconsistently) use them as you get them...
 
Well of course it is. Obviously there's something I do wrong because I wouldn't have bothered if I could get it to do it for me.
 

slyz

Developer
I decided to necro this oh-so-useful thread. Here's a little alias I wrote after discovering that we actually could access substats with my_basestat(). It returns the amouns of substats needed to reach the next level.
Code:
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));
 

Bale

Minion
Here's one I like for making sure that my GGG's nutritional requirements aren't too much for my in-a-box to withstand. I'd hate to break my chef in hardcore...

Code:
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");
 

Bale

Minion
I decided to necro this oh-so-useful thread. Here's a little alias I wrote after discovering that we actually could access substats with my_basestat(). It returns the amouns of substats needed to reach the next level.
Code:
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));

I wonder if I'm mentioning something unnecessary, but if you hover your cursor over the level bar on the main interface (just under the place where it tells you your current level) a little tooltip will tell you that information... (pardon me if you already knew that)
 
Top