aliases

Now that the gift-a-pult makes you able to hurt Uncle Hobo with gift items I put together the following alias to see which gift items I have in my inventory:

Code:
gifts => ash batch_open(); int[item] inventory = get_inventory(); foreach it in inventory { if(is_giftable(it)&&!is_tradeable(it)) {print("You have " + inventory[it] + " of " + it + ". It will do ~" + 2* autosell_price(it) + " in damage to Uncle Hobo.");}} batch_close();

The output could probably be prettified but it works :)
 
Is there a reason for batch_open() & batch_close()? You're not moving items to or from closet, mall, stash, hangnks or display case, nor are you autoselling anything. Is there a use for those functions I am unaware of? Of which I am unaware?
 
Last edited:
No, they are mostly there because the get_inventory()-example on the wiki used it (that one does put things in the closet I think) and I thought that it probably wouldn't hurt :)
 
I honestly have no idea what to say in response. My vocabulary seems hopelessly inadequate to the task of framing my emotional response in type. I suppose all I can tell you is, "Gahrraackt?!!"
 
Until the new Cyrpt's Evilometer is tracked by Mafia, here is a handy alias:
Code:
alias evil => ashq matcher ev=create_matcher(">([^:>]+: <b>\\d+</b>)",visit_url("inv_use.php?whichitem=4964"));while(ev.find())print_html(ev.group(1));
and the result:
Code:
> evil

Total evil: [B]182[/B]
Alcove: [B]32[/B]
Cranny: [B]50[/B]
Niche: [B]50[/B]
Nook: [B]50[/B]
 
Not bad. I hope that this is something that will get tracked by mafia though so we can check it without that page hit.
 
One slight problem with that alias... it breaks UniversalRecovery. Changed its name to checkevil and UR runs properly again.
 
And now with the Mafia properties:
Code:
alias cevil => ashq foreach l in $strings[Total,Alcove,Cranny,Niche,Nook] print_html("<b>"+l+"</b> - "+get_property("cyrpt"+l+"Evilness"));
Code:
> cevil

[B]Total[/B] - 0
[B]Alcove[/B] - 0
[B]Cranny[/B] - 0
[B]Niche[/B] - 0
[B]Nook[/B] - 0
 
My new, Bee-unfriendly alias to get big rocks. It accounts for being hated by Bees and closeted clovers.

Code:
alias getrock => ash if(item_amount($item[casino pass]) > 0 || my_meat() > 99) {retrieve_item(1,$item[casino pass]); if(my_meat() < 10) {print("You need at least 10 meat to play the slots!", "red"); exit;} string old=get_property("cloverProtectActive"); set_property("cloverProtectActive", "false"); if(item_amount($item[ten-leaf clover])+(item_amount($item[disassembled clover]) * to_int(my_path() != "Bees Hate You")) < 1) {if(closet_amount($item[ten-leaf clover]) > 0) take_closet(1, $item[ten-leaf clover]); else if(closet_amount($item[disassembled clover]) > 0 && my_path() != "Bees Hate You") take_closet(1, $item[disassembled clover]);} if(retrieve_item(1, $item[ten-leaf clover])) adventure(1, $location[Lemon Party]); else print("You need a clover to get your rock!"); set_property("cloverProtectActive", old);} else print("No access to the Casino.", "red");
 
I changed my cevil alias to not show the zones that I've finished.

Code:
cevil => ashq foreach l in $strings[Total,Alcove,Cranny,Niche,Nook] if(get_property("cyrpt"+l+"Evilness").to_int() > 0) print_html("<b>"+l+"</b> - "+get_property("cyrpt"+l+"Evilness"))
 
Sombrero mover

Here's my lazy alias for moving the spangly sombrero between my outfit and hatrack.
Code:
spangly => ashq if ((equipped_item($slot[hat]) == $item[spangly sombrero])){ use_familiar ($familiar[mad hatrack]); equip($slot[ familiar ], $item[ spangly sombrero ]); equip (get_property("last_hat").to_item()); } else{ set_property("last_hat", equipped_item($slot[hat]).to_string()); equip ($item[ spangly sombrero ]); }

Edit:
I've edited this slightly to remember and re-equip the previous hat on handing the sombrero over to the hatrack.
 
Last edited:
Not quite as ugly as sin (but close), this is the current modified in-run version of my sellwoss alias, to sell off my Wossname items into meat. Using this so I can run with the lute and make a profit instead of running with sackbut and watching my meat slowly (or quickly) dwindle.
alias sellwossi => ashq import <wossname.ash> turn_stuff_in(false); item itemsell = $item[fancy seashell necklace]; coinmaster itemcoin = itemsell.seller; if (itemcoin.available_tokens > 5) buy(itemcoin, (itemcoin.available_tokens / 5), itemsell); autosell(item_amount(itemsell), itemsell); itemsell = $item[commemorative war stein]; itemcoin = itemsell.seller; if (itemcoin.available_tokens > 5) buy(itemcoin, (itemcoin.available_tokens / 5), itemsell); autosell(item_amount(itemsell), itemsell);
Basically, import the wossname script and turn stuff in, not selling automatically, because I don't want to get bombs, I'd rather keep the extra tokens and build up credit for later. If I end up with bombs in the end, that's fine... but along the way, as much meat as possible. :) Then, if I have at least 5 credits, buy the hippy meat item. If I have any of them, sell them. Repeat for frats.
 
New alias for me:
alias toggleskills => ashq visit_url("http://127.0.0.1:60080/skills.php?action=toggleshow&pwd="+my_hash())
Realized today that while you can show your unusable skills (and lose the ability to go straight to the guild), you can't easily hide them back again. Without manually knowing both your password hash and that link. Now I can toggle this and can see which skills are unusable without needing to feel frustration at fighting past them forever...
 
As I script, I have been gradually refining and adding features to my "ref" aliases. These add commonly desired information, Wiki links that work from the CLI, and I think a few of them match numbers as well as names.

Code:
effectref => ashq foreach e in $effects[] if (e.to_lower_case().contains_text($string[%%].to_lower_case())) print_html(to_int(e)+": <a href='http://kol.coldfront.net/thekolwiki/index.php/Special:Search?search="+url_encode(e)+"'>"+e+"</a>"+(e.default == "" ? "" : " ("+e.default+")"))

famref => ash foreach f in $familiars[] if(f.to_lower_case().contains_text($string[%%].to_lower_case()) || to_string(to_int(f)).contains_text($string[%%])) print(to_int(f)+": "+f+(have_familiar(f) ? " (have)" : ""))

itemref => ashq foreach i in $items[] if(i.to_lower_case().contains_text($string[%%].to_lower_case()) || to_string(to_int(i)).contains_text($string[%%])) print_html(to_int(i)+": <a href='http://kol.coldfront.net/thekolwiki/index.php/Special:Search?search="+url_encode(i)+"'>"+i+"</a>"+(item_type(i) == "" ? "" : " ("+item_type(i)+")")+(item_amount(i) > 0 ? ("+item_amount(i)+")" : ""))

monsteref => ashq foreach m in $monsters[] if (m.to_lower_case().contains_text($string[%%].to_lower_case())) print_html("<a href='http://kol.coldfront.net/thekolwiki/index.php/Special:Search?search="+url_encode(m)+"'>"+m+"</a> ("+m.phylum+")")

skillref => ashq foreach s in $skills[] if(s.to_lower_case().contains_text($string[%%].to_lower_case()) || to_string(to_int(s)).contains_text($string[%%])) print_html(to_int(s)+": <a href='http://kol.coldfront.net/thekolwiki/index.php/Special:Search?search="+url_encode(s)+"'>"+s+"</a>")

These and the "prefref" alias are by far the most useful aliases I have. I hope you enjoy the enhancements.

But just for gits and shiggles, here's another one I use every run:

Code:
hegemony => ash import <zlib.ash> repeat { obtain(1,"hedge maze puzzle", $location[Sorceress' Hedge Maze]); } until (hedgemaze());
 
I had been using Bale's advent alias to punch out my advent bits happily. Unfortunately, it wasn't working for me this year. That means that a new solution needed to be made, and the following alias was what I came up with.
alias advent => ashq if(substring(today_to_string(), 4, 6) == "12") { string advent = visit_url("campground.php?action=advent"); while (true) { if (!contains_text(advent, "a href=campground.php?preaction=openadvent&whichadvent=")) break; int adventindex = index_of(advent, "whichadvent=")+12; visit_url("campground.php?preaction=openadvent&whichadvent="+substring(advent, adventindex, adventindex+1)); advent = substring(advent, adventindex); } }
Same starting point... if today is officially in December, check the advent calendar. However, we now look for the whichadvent string, and punch out the specific advent days. It's VERY possible that it will break in 5 days when whichadvent goes to 2 digits, at which point I'll need to change the +1 to +2. :D

I should really have regexp-ed it, but my brain was tired and I wanted something that worked again. This does. At least until next Monday.
 
Thank you! I was planning to rewrite that today and you just saved me the work! I'm glad I've been putting it off. :)

Edit: Wouldn't while(contains_text(advent, "a href=campground.php?preaction=openadvent&whichadvent=")) be more sensible than while(true) and having the parameter as a break?
 
Last edited:
Yes, but I was working based on the parse_skill_block(string, boolean) from a charsheet.ash relay script. :) It ran with the while (true) instead of doing while (contains_text(string, "<br>")), so... that's what I ended up with. Good catch for a cleanup though. :)
 
Back
Top