Pre-ascension chose what you want to have in Hangk script

Atan

New member
Do you have a softcore character, and want to make sure that Hangk's contains all items needed to complete all of the game's quests for two ascensions in a row, jus in case? Are you usually hardcore, and would like to keep some stuff in Hangk for use after the gash, but prefer to sell everything else that you don't put into your Display Case?

Then this script might be for you. What it does is, after you configure a list of items you want, and quantities you want available per ascension, it tries to stuff in the closet at least enough for a minimum amount min_look_ahead of ascensions you set, and at most for a maximal amount max_look_ahead.

If it doesn't find enough of an item in your inventory, it will either try to re-stock by buying, or suggest you create/build more, without actually doing anything itself, depending on the value of the boolean actual_buy.

Besides the previous variables, you also need to configure the actual list of items you want, which is stored in the variable called hankables (in non-gnomish spelling :eek:), mapping item names to quantities expected to be consumed each ascension. A quantity of 0 means an item that won't be consumed, so you really want it only once, whatever your "look ahead" - useful for equipment and instruments.

Finally, you can optionnally make the script more verbose.


Disclaimer: This is my very first Kolmafia script, written from scratch (kudos to all the sample scripts in this forum, though). I think it works fine, but may have overlooked something, and definitely can have written parts of the code sub-optimaly

Future improvements (which I don't know how to do, really): It would be nice to read the list of items from a file, so you can edit that without touching the script, and even better if there coud be separate files for separate characters. Presently you need to have a different copy of the script for each character, which is bad practice, since if you change the code you need to do it in each file (possible temporary workaround: include the main code from each character's file from a common library file).
 

Attachments

  • hankables.ash
    5.2 KB · Views: 136
Top