Feature - Implemented Better alias display

Bale

Minion
Some of us have very cluttered alias lists.

> alias

boxen => ashq print("Chef turns used: "+get_property("chefTurnsUsed")); print("Bartender turns used: "+get_property("bartenderTurnsUsed"));
dentures => checkpoint ; acquire 3 hot wing; equip frilly skirt; ashq if(closet_amount($item[hot wing])>=3) take_closet(3, $item[hot wing]); visit_url("inv_use.php?which=3&whichitem=2951&pwd"); visit_url("choice.php?whichchoice=188&option=3&choiceform3=Catburgle&pwd"); outfit("checkpoint");
desc => ash int[int] m ; file_to_map("itemdescs.txt", m); cli_execute("text desc_item.php?whichitem=" + m[$item[%%].to_int()])
getrock => ash string old=get_property("cloverProtectActive") ; set_property("cloverProtectActive", "false"); if(item_amount($item[ten-leaf clover])>0) adventure(1, $location[Lemon Party]); else if(item_amount($item[disassembled clover]) > 0){use(1, $item[disassembled clover]); adventure(1, $location[Lemon Party]);}else print("You need a clover to get your rock!");set_property("cloverProtectActive", old);
getscrewed => ash visit_url("town_right.php?place=untinker") ; visit_url("knoll.php?place=smith"); visit_url("town_right.php?place=untinker"); cli_execute("untinker bitch meat");
gmorn => ash if(available_amount($item[stinky cheese eye]) 1) cli_execute("fold stinky cheese eye"); string typer = ""; if(my_primestat() == $stat[muscle]) typer = ", +melee"; else if(my_primestat() == $stat[moxie]) typer = ", -melee"; cli_execute("maximize item, +equip stinky cheese eye"+typer);
gnight => ash if(available_amount($item[stinky cheese diaper]) 1) cli_execute("fold stinky cheese diaper"); if(have_effect($effect[ode to booze]) 1) use_skill(1, $skill[ode to booze]); equip($item[tuxedo shirt]); drink(1, $item[rockin' wagon]); cli_execute("maximize adv");
Trying to make sense of that is really tough. Even worse, < doesn't display so "< 1" looks like " 1". Could you please alter that display to;

> alias

boxen => ashq print("Chef turns used: "+get_property("chefTurnsUsed")); print("Bartender turns used: "+get_property("bartenderTurnsUsed"));

dentures => checkpoint ; acquire 3 hot wing; equip frilly skirt; ashq if(closet_amount($item[hot wing])>=3) take_closet(3, $item[hot wing]); visit_url("inv_use.php?which=3&whichitem=2951&pwd"); visit_url("choice.php?whichchoice=188&option=3&choiceform3=Catburgle&pwd"); outfit("checkpoint");

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

getrock => ash string old=get_property("cloverProtectActive") ; set_property("cloverProtectActive", "false"); if(item_amount($item[ten-leaf clover])>0) adventure(1, $location[Lemon Party]); else if(item_amount($item[disassembled clover]) > 0){use(1, $item[disassembled clover]); adventure(1, $location[Lemon Party]);}else print("You need a clover to get your rock!");set_property("cloverProtectActive", old);

getscrewed => ash visit_url("town_right.php?place=untinker") ; visit_url("knoll.php?place=smith"); visit_url("town_right.php?place=untinker"); cli_execute("untinker bitch meat");

gmorn => ash if(available_amount($item[stinky cheese eye]) < 1) cli_execute("fold stinky cheese eye"); string typer = ""; if(my_primestat() == $stat[muscle]) typer = ", +melee"; else if(my_primestat() == $stat[moxie]) typer = ", -melee"; cli_execute("maximize item, +equip stinky cheese eye"+typer);

gnight => ash if(available_amount($item[stinky cheese diaper]) < 1) cli_execute("fold stinky cheese diaper"); if(have_effect($effect[ode to booze]) 1) use_skill(1, $skill[ode to booze]); equip($item[tuxedo shirt]); drink(1, $item[rockin' wagon]); cli_execute("maximize adv");
 
Last edited by a moderator:
I would love it if things between angle brackets <> in the alias didn't disappear in the alias display. (I suppose I could file a separate bug report about this instead of cluttering Bale's feature request, but it is a very trivial bug and seems so related to Bale's request...) E.g. when I have "import <scriptname.ash>" in an alias, all I see in the display is "import "
 

fronobulax

Developer
Staff member
r8284 - Added a line break between the items printed by the alias command so there is at least a little space. Tested and checked in but there is always an outside possibility that the fix is Windows specific :-( Not sure how to add text formatting (i.e. the bold in Bale's example) and need develop a test case for the angle bracket problem.
 

Veracity

Developer
Staff member
You found the standard way to get your system's idea of a line break, although it would be better to use the one in KoLConstants.
You add boldness by inserting HTML tags.
You can show angle brackets by escaping the string to add character entities as needed.

Revision 8285 does all of the above.
 

Bale

Minion
Thank you very much. It looks much better.

And thanks to visible angle brackets I can copy-paste without worry when I want to edit one.
 

Geno

New member
Are those gmorn and gnight stinky cheese squish commands available as a script? that would be super helpful. I haven't found any scripts for that function through the search.
 

Bale

Minion
Well, they're just quicky aftercore stuff I use when I don't care to fiddle or optimize. Any script I use seriously would be much more detailed, but you can make them a script if you like. Copy-paste. As script functions they'd look like this:

Code:
void gmorn() {
if(available_amount($item[stinky cheese eye]) < 1) 
   cli_execute("fold stinky cheese eye");
string typer = "";
if(my_primestat() == $stat[muscle])
   typer = ", +melee";
else if(my_primestat() == $stat[moxie])
   typer = ", -melee";
cli_execute("maximize item, +equip stinky cheese eye"+typer);
}

void gnight() {
if(available_amount($item[stinky cheese diaper]) < 1)
   cli_execute("fold stinky cheese diaper");
if(have_effect($effect[ode to booze]) 1)
   use_skill(1, $skill[ode to booze]);
equip($item[tuxedo shirt]);
drink(1, $item[rockin' wagon]);
cli_execute("maximize adv");
}
As you see, the biggest difference is that I remove "ash" from the front. Most of the rest is just formatting changes to make them readable, but they'd work without the formatting.
 

slyz

Developer
Code:
gmorn => ash if(available_amount($item[stinky cheese eye]) < 1) cli_execute("fold stinky cheese eye"); string typer = ""; if(my_primestat() == $stat[muscle]) typer = ", +melee"; else if(my_primestat() == $stat[moxie]) typer = ", -melee"; cli_execute("maximize item, +equip stinky cheese eye"+typer);
This actually is an ash script. All you need to do is take the ash part, copy it in a text file in a non formating text editor (like notepad), and save the file as gmorn.ash. You can then point the "on login" preference to it.

If you want to understand the code bit a little better, formatting it would be nice though:
Code:
if(available_amount($item[stinky cheese eye]) < 1)
	cli_execute("fold stinky cheese eye");
string typer = "";
if(my_primestat() == $stat[muscle])
	typer = ", +melee";
else if(my_primestat() == $stat[moxie])
	typer = ", -melee";
cli_execute("maximize item, +equip stinky cheese eye"+typer);
All you need is make sure you have at least 1 stinky cheese item, and this bit of code will make sure you have a stinky cheese eye, then call the maximizer with the command line "maximize item, +equip stinky cheese eye", adding "+melee", "-melee" or nothing depending on your mainstat.

This is a highly personalised alias that Bale didn't intend to be used by others though. It's a good start if you want to do the same sort of thing on logon though.

the gnight alias will make sure you have a diaper, cast Ode, and overdrink, and the same thing applies if you want to turn it into an ash script.

Or maybe I just failed to understand your question, and you were simply looking for the CLI fold command. In that case, type help fold in the gCLI to know how it works.

EDIT: ninja'd.
 
Last edited:

Bale

Minion
Or maybe I just failed to understand your question, and you were simply looking for the CLI fold command. In that case, type help fold in the gCLI to know how it works.

Oh. That's probably what he meant. He thought I was calling a script called fold. Yeah, it's a CLI command. We both wasted a lot more time on an answer than was necessary.
 

Geno

New member
No, I know about the command. I was asking if there was a script to do it for you. So thanks!

Is it really that easy to make an .ash? I would've figured you'd need a compiler or some such programming stuffs I don't know about. If you haven't figured it out by now I'm a total nub.

Just wondering, but if you have two eyes will the gnight script squish both of them or only one? My hope is that it only does one.

Thanks again!
 

Bale

Minion
As lostcalpolydude says, you need to use notepad, not word. All scripts are straight text files. No compiling is necessary.

If the text editor can has formatting ability like changing font, text size or color, then it will mess up a script file. My personal favorite free editor for writing scripts is notepad++.

Just wondering, but if you have two eyes will the gnight script squish both of them or only one? My hope is that it only does one.
Only one, just as you hoped.
 
Top