Get_skill.ash - CLI accessible skill acquisition

kitsunenine

New member
Hi all,
I recently found myself unable to find a functionality I'd like KoLMafia to have - the ability to acquire a skill directly from the command line. So, I wrote a little helper script to do that for me. As it explains when you first call it, simply typing "alias get_skill => ash import <get_skill.ash> get_skill($skill[%%])" will allow you to get most skills directly from the CLI, and if it can't, it'll tell you why not.

It's currently a work in progress - I still haven't quite gotten around to writing in Meansucker's section yet, and the combat skill section is a little lacking, but they will come very soon.

Have fun!
K.
 

Attachments

When I try to use this, I get the following error:
get_skill lust

Bad item value: "" (get_skill.ash, line 592)
Returned: void

I used lust as a sample skill, because that's one I actually had the meat and bits for... same failure with:
get_skill superhuman cocktailcrafting

Bad item value: "" (get_skill.ash, line 592)
Returned: void
 
When I try to use this, I get the following error:

I used lust as a sample skill, because that's one I actually had the meat and bits for... same failure with:

Seeing as the original post states that Meansucker's skills are not in there yet, the first one is hardly surprising, that doesn't help with the second one though :)
 
Before I used that as an example, I did throw it into a search... lust is found in line 160, where it's defined as needing bad moon. It's counted in line 668, where the price for BM skills are considered. And then it's supposed to tell me that he hasn't done BM, or if 'GET_GUILD_SKILL' is disabled or I don't have enough meat, the price. (lines 675-686)

Unless I don't understand the way he's coded this at all? He only says he hasn't coded in Meansucker's section... not that the consideration of BM skills is missing or anything like that.
 
Glancing at it, line 592 should be if(skill_list[sk].itm==$item[none]) {. Haven't really bothered to use it yet, though.
 
Awesome, with heeheehee's change, I get:
get_skill lust

Um. I've not done Meansucker's code yet. Try me later.

Update to kitsunenine's alias suggestion above... I'd suggest using ashq instead of ash. You still get his writeouts, and it skips the return, which may or may not be accurate... Well, it's probably accurate except for BM skills, due to what he wrote above about not coding them. :) Since I'm in BM now, maybe I'll try to get this updated... Eh.
 
Looking slightly more at the code, it's just missing the URLs, really. (which should be buildable from a base via skill numbers)
 
Okay, made heeheehee's change to the item check, put in what I believe should be the BM skill location (heydeze.php?action=skillGET), and fixed the "not enough meat" message for BM, as it was based on price for skills staying at 400 and never going up. Basically, just moved the (400*2^num_BM) check into where it had previously done skill_list[sk].price.

Attached tweaked version here. If kitsunenine prefers, I'll remove my upload.

Edit: Updated below.
 
Last edited:
Few more tweaks... used it on a few class skills and was wondering why first, it didn't buy, and after I fixed that, why I needed to manually refresh my cash after. Should have both fixed now... Updated the costs to fit the new 250/500/1000/etc scheme. Also made the "level too low" check tell you how many more levels you need to gain before you can learn the skill, and fixed a skill that was mispointed (Harpoon!) where its quest name wasn't defined.

Stuff to still do, when I remember:
Make olfaction actually know it needs lucre.
Verify that money doesn't double-subtract in display and still need manual refresh.
Next time in Moxie sign, check those skills again to verify it hasn't changed.
 
Last edited:
New version uploaded. Includes the following changes:
New exponents for BM costs... ** instead of ^.
BM skills are actually purchasable. Properly sets the names/numbers on them now.

Costs are still screwy... not sure why. Someone who actually knows how it's supposed to work could probably explain it.
 
It's interesting that when I go buy a skill it deducts the cost twice... (Had 5.5k, bought for testing purposes Cletus's Canticle of Celerity, had 3.5k in Mafia, refreshed and had 4.5k as expected)
 
Something about the way mafia parses the page does it, since all it does is hit the buy page. Maybe it's doing a post and should be doing a get, or vice versa... not sure. I mentioned that oddity above though.
 
Yeah... I mostly use it in conjunction with gluttony (eatdrink), pride, and envy. The others usually get skipped. But it does help speed their acquisition nicely. :)
 
Okay, so this hasn't gotten tested yet, but I expect it to work...
> get_skill demand sandwich

You're the wrong class. You're currently a Accordion Thief, you need to be a Avatar of Boris.
Adds a boris_level(int) function where the int is the path to check, and it should tell you which level you are in the specific path. The Boris skills have a 1-3 'num' for path, and 1-10 level for which item it is. I subtract skilldata.level-boris_level(skilldata.num) to find out how many times you'll have to learn that path to gain it. Working on the assumption that, at level 1, you have 1 skill point available, rather then getting your first skill point at level 2. If this assumption is incorrect, let me know and I'll adjust. I hope to be able to validate this as working tonight, since the first of my last BHY runs finished up yesterday and just needed a bit more seal farming for the nemesis karma, and then...

Also, as a note, the double-subtraction of meat was recently fixed by Veracity's awesomeness, so if this actually works for Boris, I expect this version to stay until the next class gets released.

Edit: Ascended into Boris, found out the level check was backwards, so it was displaying how many it needed as negative rather then positive, making it always think it had enough points left. This one actually should work forwards now, and no longer believe I can learn Gourmand at level 1...

Working now...
> get_skill gourmand

You need to gain another 7 levels first.

> get_skill song glorious lunch

You learned a new skill: Legendary Girth
You learned a new skill: Song of the Glorious Lunch

Edit: Forgot to turn the get_property into an int. Proper version uploaded.
 
Last edited:
I've been toying with this for a while, but... got bored today.
> get_skill virulence

You need to eat another 1 hunter brain first.

> get_skill ravenous pounce

You already have Ravenous Pounce!

> get_skill zombie maestro

You need to eat another 4 hunter brains first.
No server hit if you already have the skill, 1 server hit to check current zombie points, then 1 server hit per new skill learned. Can multi-learn... if I had 4 zombie points, I could get maestro in 5 total server hits, which is less than it would take to fully launch the relay browser once. So that's good for hits, at least. Anyways, the "excise" function comes from zlib, so that's needed as well now.

Also took care of a pet peeve... you can see in the quote above that it properly pluralizes if you have multiple, singles if you don't. Yay. Setting an int for the needed levels (or needed brains) so it only needs to do the calculation once and we can both show it to you as well as use it for deciding the proper word ending.
 
Can it be set to acquire all boris / zombie skills if you max out your runs? I start with 30 boris points, so what about get_skill Fighting Tree (or its zombie equivalent)?
 
Easiest way to do that is, if you have newLife, run:
ashq import <newlife.ash>; path_skills(false);
That will just train all ZM or AoB skills to 30 if you have 30 points when you check. If you want to do more specific, just get_skill <specific skill you want> using this script. Example, get_skill ravenous pounce will get all 10 skills in the Hunger tree.
 
Update... the skill acquisition for item skills was broken if you didn't already have the item.
> get_skill awesome balls of fire

You got to a weird place. Failing...
Not really useful. Better... this uses your item acquisition settings, so it won't screw up things if your aBPL is set to a reasonable amount and so on.
> get_skill awesome balls of fire

Searching for "Kissin' Cousins"...
Search complete.
Purchasing Kissin' Cousins (1 @ 8,650)...
You acquire an item: Kissin' Cousins
Purchases complete.
Using 1 Kissin' Cousins...
You learned a new skill: Awesome Balls of Fire
Finished using 1 Kissin' Cousins.

> get_skill transc olfaction

Verifying ingredients for Manual of Transcendent Olfaction (1)...
Purchasing Manual of Transcendent Olfaction (1 @ 200 lucres)...
Visiting the Bounty Hunter Hunter...
You acquire an item: Manual of Transcendent Olfaction
Bounty Hunter Hunter successfully looted!
Successfully created Manual of Transcendent Olfaction (1)
Using 1 Manual of Transcendent Olfaction...
You learned a new skill: Transcendent Olfaction
Finished using 1 Manual of Transcendent Olfaction.
Also added TO to the list of known item skills.

Possibly an issue: script only knows about the un-used items... not an issue with books like Kissin' Cousins, but possibly nasty if you set your aBPL to a million or something stupid, or you're saving up skill books to sell later but don't have them in your mall for some reason.

Anyways, this lets me more easily pick up fun/cheap skills. And more painful ones like TO that I've been working towards for a while. :D

Edit: Not completely sure on this since I don't have a bunch in my inventory at the moment, but... the newly attached version should try to use (used) copies of skill books before breaking another one.
 
Last edited:
For the one person who actually grabbed this, realized when I tried to use this for parsing unlearned item skills today that I had typoed when adding the field guide. SkeletAL anatomy, not SkeletON. Bah. Anyways, the attached version successfully runs. And lets me, in conjunction with nifty aliases, find out all unlearned item skills I can get from the mall. :)
 

Attachments

Back
Top