PDA

View Full Version : Get_skill.ash - CLI accessible skill acquisition



kitsunenine
06-01-2010, 01:01 PM
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.

Theraze
08-24-2010, 04:22 AM
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

Winterbay
08-24-2010, 09:55 AM
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 :)

Theraze
08-24-2010, 01:25 PM
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.

heeheehee
08-24-2010, 02:20 PM
Glancing at it, line 592 should be if(skill_list[sk].itm==$item[none]) {. Haven't really bothered to use it yet, though.

Theraze
08-24-2010, 02:43 PM
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.

heeheehee
08-24-2010, 02:50 PM
Looking slightly more at the code, it's just missing the URLs, really. (which should be buildable from a base via skill numbers)

Theraze
08-25-2010, 06:18 AM
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.

Theraze
08-26-2010, 06:54 AM
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.

Theraze
01-19-2011, 03:44 AM
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.

Winterbay
01-19-2011, 10:28 AM
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)

Theraze
01-19-2011, 01:24 PM
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.

Winterbay
01-19-2011, 01:50 PM
Ahh, my fault for interpreting it to only be in conjunction with the BM costs :)

Theraze
01-19-2011, 02:14 PM
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. :)

Theraze
02-16-2012, 09:38 PM
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.