autoBasement.ash - Better basement automation

Rinn

Developer
Note from Minion, Bale: Winterbay has been providing some unofficial modifications to this script since Rinn has not updated it for some time. You can find information about Winterbay's current version in the second post, HERE.

The script has been moved to SVN for installation and updating. In order to install the script you need a recent build of Kol Mafia. After logging in type the following in the CLI and press enter:
Code:
svn checkout https://svn.code.sf.net/p/winterbay-mafia/autobasement/code/

AutoBasement

[requires zlib]
[automatically downloads a data file from zarqon's server]

I hate the basement, I've never enjoyed basement diving, and I don't believe I ever will. I also dislike mafia's internal basement handling for several reasons:

  • Uses specific outfits
  • Won't change familiars
  • Won't use (cheap) potions
This leads to several problems, most notably my incomplete telescope. So like every other problem I encounter in KoL I script it into submission.

Features:

  • Uses maximize functionality instead of outfits before all your base stats are above 200.
  • Will swap to relevant familiars when maximizing (Disembodied Hand, Exotic Parrot)
  • Uses cost effective potions if necessary
  • Chooses mainstat, then lowest offstat for stat choice adventures
  • Maximizes mp regen on stat choice adventures
  • Maximizes for desired stat and equips a sombrero type familiar for combats (Note you need to make sure your ccs can handle whatever you're fighting if you wish to automate combats). You can also set certain equipment to be used for combats in the settings.
  • You can set certain conditions to halt processing, either based on the type of basement test or on amount of mp a festering powder requires.
  • Will use Jumbo Dr. Lucifers to restore mp if enabled, the related vars are 'autoBasement_use_dr_lucifer' and 'autoBasement_use_dr_lucifer_amount'.
  • Caches outfits if your basestats are greater then 200.
  • Uses zlib for version checking and saving variables.
Possible Improvements:

  • The order in which potions are used could probably be optimized even more
  • Support for consuming stat increasing food/booze/spleen items
  • Self-buffing
  • Caching outfits is necessary, but painfully slow. Bale's suggestion would really help.
Revision History:
2.0 Updated because of zlib update
1.9 Removed previously added mpdrain feature, use -familiar for maximizer if you don't have a Disembodied Hand.
1.8 Save an additional outfit for mpdrain that considers moxie, use whatever stat is currently buffed higher at the moment for mp test. Add var to control what stat is buffed for combats.
1.7 Reduce number of page hits during outfit caching by wearing the previous version of that outfit before maximizing, therefore if the result is the same no equipment will equipped piece by piece. Really need functions that return maximizer results and outfit contents.
1.6 Potions moved into a data file (will be automatically downloaded). Sort potions by cost effectiveness. Add var for equipment to force for combats. Renamed autoBasement_get_drops to autoBasement_get_familiar_drops. have_outfit doesn't work on custom outfits apparently, so that check is removed.
1.5 Fixed checking for outfit caching incorrectly, fixed not restoring mp if the mp to restore was greater than autoBasement_use_dr_lucifer_amount but autoBasement_use_dr_lucifer was false. Added print to say how many turns were automated and if successful or not.
1.4 Was checking false instead of true for elemental tests, was also using the incorrect equalizer potion, both fixed.
1.3 Added some of slyz's improvements, a bunch of optimizations, and outfit caching if all your base stats are greater then 200.
1.2 Changed print to vprint, added bale's mp recovery (you'll have to enable the related vars), and fixed the issue with Ben-Gal™ Balm.
1.1 Added some additional output to say why the script refuses to continue automation.
1.0 Initial Release
 
Last edited by a moderator:
Unofficial Support for autoBasement.ash

AutoBasement 4.0

Thanks to Bale for creating this nice spot for my modification of the script.

The version of autoBasement in this post is a fork of Rinn's original script. From version 3.0 to 3.4 there were only minor changes, but as of version 4.0 a lot of things has changed. The script no longer uses its own data file (that can now safely be deleted) and instead uses Mafia's powerful maximizer tool to try and pass tests. All settings that were in use in the previous version are still in use, but a few have been added (see below for all settings that can be tweaked).

Also, as of version 4.0 (released on 2013-06-14) the script has been moved to SVN for installation and updating. In order to install the script you need a recent build of Kol Mafia. After logging in type the following in the CLI and press enter:
Code:
svn checkout https://svn.code.sf.net/p/winterbay-mafia/autobasement/code/

After the command has run you will have autoBasement.ash in your /scripts folder. In case you get a prompt about overwriting files press OK (if not make sure that any older versions of autoBasement.ash is removed). In order to update the script in the future either type svn update in the CLI or tick "Update installed SVN projects on login" in Mafia's preferences (found at the bottom under SVN). As of r12218 you can move the script to any location you want in your scripts folder after it has finished installing.



There are quite a lot of variables that can be set in order to get the script to run in specific ways and/or stop at specific points. This list is here to help people choosing what to change for their specific manors of using it.

To change them run he script at least once and then type the following in the CLI:
Code:
zlib <variable_name> = <setting_value>

Conditions to stop automation
  • autoBasement_break_on_combat: Makes the script stop if it encounters a fight, default is false
  • autoBasement_break_on_hp: Makes the script stop if it encounters a HP-test, default is false
  • autoBasement_break_on_mp: Makes the script stop if it encounters a MP-test, default is false
  • autoBasement_break_on_mox: Makes the script stop if it encounters a Moxie-test, default is false
  • autoBasement_break_on_mys: Makes the script stop if it encounters a Myst-test, default is false
  • autoBasement_break_on_mus: Makes the script stop if it encounters a Muscle-test, default is false
  • autoBasement_break_on_element: Makes the script stop if it encounters a Elemental-test, default is false
  • autoBasement_break_on_stat: Makes the script stop if it encounters a Stat-reward, default is false
  • autoBasement_break_on_reward: Makes the script stop if it encounters a big reward, default is false
  • autoBasement_break_on_floor: Makes the script stop when it comes to the specified floor, default is 500
  • autoBasement_break_on_level: Makes the script stop when it reaches the specified level, default is 30
  • autoBasement_break_on_mp_amount: Makes the script stop at MP tests where the needed amount is higher than the specified value, default is 2000

Variables that govern whether mp can be restored with a Jumbo Dr. Lucifer, and how much mp needs to be restored before using it.
  • autoBasement_use_dr_lucifer: Is the script allowed to use Lucifers?, default is false
  • autoBasement_use_dr_lucifer_amount: What's the minimum value to be restored before using a Lucifer, default is 1000

Variables that govern whether eating, drinking or spleening can be used to buff you up (new as of 4.0)


  • autoBasement_eat_to_buff: Allows eating to buff, default is false
  • autoBasement_drink_to_buff: Allows drinking to buff, default is false
  • autoBasement_spleen_to_buff: Allows spleening to buff, default is false
  • autoBasement_hop_on_up: Allows usage of goofballs, default is false

Variables for combat
  • autoBasement_combat_equipment: A comma-delimited list of items to equip when fighting, default is "navel ring of navel gazing". If you want to use more than one of an item list it twice, but make sure that you have the stated amount because the script will most likely fail otherwise. Items not in your possession will be ignored.
  • autoBasement_combat_stat: The stat to maximize when entering combat, default is Muscle
  • autoBasement_combat_maximizer_string: Additional string to maximize for when buliding the combat outfit. Useful if you want to add spell damage or similar, default is nothing

Familiar related settings
  • autoBasement_get_familiar_drops: Should the script switch between limited per-day item-dropping familiars (if set to false the script will try to use a hovering sombrero or baby sandworm), default is false
  • autoBasement_use_Disembodied_Hand: Should the hand be used at all, default is true
  • is_100_run: Standard zlib-variable, overrides autoBasement_get_familiar_drops if set to anything but none as to which familiar to use in figths.

Potion related settings
  • autoBasement_max_potion_price: The maximum amount you are willing to pay for a potion, default is 2000
  • autoBasement_use_percentage_potions: Sets if the script should use percentage based potions, default is true
  • autoBasement_use_absolute_potions: Sets if the script should use absolute based potions (not recommended), default is false

Version History:
04-19-2011: First changed version uploaded. Fixes equipment being used by a hand or hatrack, the migration from ^ to ** for exponentials and switching outfits where an item you only have one of jumps between the main hand and your offhand.
04-20-2011: Fixed a bug in the strip_familiar-function and changed to eatsilent (thanks mredge73)
04-23-2011: Modified the reading of the combat_stat variable to avoid problems with misspelled variables. Now accepts anything that has a u,y or o as the second character...
04-26-2011: Fix the fix in the previous update...
07-03-2011: Add the Li'l Xenomorph as an item-dropping familiar and make the switching between them be slightly more efficient.
07-22-2011: Stop autoBasement from changing familiar if you are on a 100% run (controlled by the zlib-setting is_100_run)
07-27-2011: Add missing ; to make the script not fail on execution.*sigh*
08-18-2011: Add the Rogue Program as an item-dropping familiar
08-19-2011: Fix familiar dropping logic. Thanks fxer for pointing out the error.
08-21-2011: Fix the familiar dropping logic for sure this time :)
08-22-2011: Not to be overly confident, but I do believe this familiar dropping fix might be the last...
08-25-2011: This is getting to be a bad habit, but the familiar dropping part have been poked at again...
08-27-2011: Make it so it uses the Sandworm even if you're not going for all item drops, the way it was way back when.
10-14-2011: Change all cli_execute(maximize) calls into maximize()-calls instead.
11-27-2011: Modify the Gauntlet-part of the script a bit to be more reliant on DA
01-09-2012: Fix the stupid maximize call.
01-16-2012: Make sure the script can handle figths under Just the best Anapest and add the new itemdroppign familiars to the potential rotation
01-16-2012: Make sure we don't abort if we cannot equip an outfit during setup and fix adding the new familiars
01-20-2012: Just in case it ever comes up, we now also strip the pants of the scarecrow if necessary. Print a success massage after each floor to lessen confusion.
06-04-2012: Push version number to 3.0. That's the only change :)
29-04-2012 (3.1): Add autoBasement_use_Disembodied_Hand to toggle the use of the hand on or off
14-05-2012 (3.2): Set the script up to purchase wrestler stickers and sugar shorts (they are cheap and give good stat boni)

09-07-2012 (3.3): Force a refresh of your equippment when caching outfits in order to compensate for Mafia getting out of synch for whatever reason.
11-08-2012 (3.4): Add breaks to all if-checks in switches
06-05-2013 (4.0): Major update to make the script use the new maximize-features and no longer rely on the built-in datafile
06-05-2013: Consolidate the check for not ok commands into the ok()-function
06-08-2013: Point out that raising autoBasement_max_potion_price might help with getting past failed levels
06-11-2013: If max_potion_price is larger than autoBuyPriceLimit, raise the latter to the former (and reset at the end of the script)
Make sure we equip the cached outfits before we do the test for which it is intended
Don't abort due to being Beaten Up if we can remove it
Make sure we honor the combat-equipment setting when maximizing
Make sure that we continue to honor the disallowing of precentage based and absolute potions
Fix several bugs with the maximize_wrap function and the elemental_test function that would lead to either overbuffing or failure
Move the debug printing to verbosity levels 7 and 9 respectively
06-12-2013: Actually cache an Elemental Resistance outfit so we can use it
Fix bug with overbuffing for Gauntlet tests
Don't use up irreplaceable currencies (such as FDKOL and AWOL commendations)
Also don't use up the fudge wand
2013-06-13: Clean up the code for coinmaster handling
Fix the over-buffing for the Gauntlet for real (hopefully)
2013-06-14: Remove version checking. Official release of the SVN version

2013-06-18: Attempt to make sure we have at least 10% more HP than we would be hit for by the next monster if we get hit
Add new zlib variable autoBasement_combat_maximizer_string which will augment the choosen combat-stat if wanted

2013-06-20: Donät use goofballs unless autoBasement_hop_on_up is true (default false)
 
Last edited:
It will stop without attempting the level it currently tried to buff for. I'm slightly overestimating the requirements so it's possible you may still be able to beat that floor, but the script won't attempt to pass that floor if it doesn't think you meet the requirement.
 
sounds great but how will you know when you're gonna get a combat

EDIT: woops misunderstood i was thinking clan basement
 
Last edited:
sounds great but how will you know when you're gonna get a combat

EDIT: woops misunderstood i was thinking clan basement

It's pretty reasonable to set your combat to divines or songs that do elemental damage according to your main stat.

But is there something that it does for the combats?
 
Make sure your ccs or battle action can handle the basement monsters, the script will stop if it loses a combat.
 
I keep returning 'Unrecognized keyword: switch disembodied hand' and 'Unrecognized keyword: switch exotic parrot' errors. I have zLib installed, so I'm at a loss as to what I've done wrong.
 
You need a newer version of mafia. The switch command was added in a recent daily build, I'm not sure of the specific revision number.
 
I havn't tried it yet but Props to Rinn!

I hate the basement, I am planning another run after the first of the year and was dreading it. Now I am optimistic!
 
Nice script, I think I will be tweaking it for using after crimbo is over. A couple of suggestions:

- For the MP test, you should maximize MP instead of Mys (the maximizer will equip a moxie magnet if it's worth it). Testing for the magnet will also let you know if you should buff moxie or myst. Also, you don't consider the +50% MP from Wisdom of the Elder Tortoises.

- For the gauntlet, you should maximize HP and DA according to this formula (I haven't verified it):
Code:
HP/(1-(√(Min(DA,1000) × 10) − 10)/100)
Apparently it's not possible directly with the maximizer, but at least using "HP, DA" would be better than just muscle. Also, take into account Spirit of Ravioli.
 
Wow. I've just began using it, and I'd like to say a big thank you, this is going to save me hours, and meat, not only today but also when I do my remaining 4 basement runs.

A small thing is that it does not consider buffing Muscle or HP for elemental tests, only elemental resistance.
 
Last edited:
Ooh! As a person with 0 telescope upgrades (I basemented to floor 100 once and got very tired of it, back before mafia's basement helper) this looks very attractive. I think after Crimbo and some more sliming I'll give this a shot and let you know how it goes.

And, I've always wanted to add telescope support to my Checklist script. This script may help me make that a reality. Thanks for sharing!
 
Your description says it maximizes muscle, but it's not happening for me.

Also, is it possible to set an outfit for combat? I'm currently a SC, so I'd like to have a two-handed club to lunging thrust-smack. I'm sure a shield would come in handy for shieldbutts as well.

However, the script just keeps trucking with whatever outfit I originally had on and gets me killed holding a teflon spatula.
 
Also, is it possible to set an outfit for combat? I'm currently a SC, so I'd like to have a two-handed club to lunging thrust-smack. I'm sure a shield would come in handy for shieldbutts as well.

However, the script just keeps trucking with whatever outfit I originally had on and gets me killed holding a teflon spatula.

Ditto as a PM, I want to be using a chefstaff for combat, was running into the same issue.

I kind of like this script though. As has been pointed out, it doesn't do the gauntlet or the mpdrain tests very well at all. For the gauntlet, all I had to do was "maximize hp; equip duct tape sword", the mpdrain was even easier as "maximize mp" always gave me enough to cover the demand.

I used it for the first 300 levels. It literally took hours of play time off. Thanks and looking forward to improvements.
 
Last edited:
Just curious... I d/l the script today to take a peek at it and I saw within the code:

Code:
cli_execute("mood basement");
cli_execute("mood execute");

So I'm assuming this means I'm supposed to have two moods corresponding to the calls but there is no mention of these moods in the first post... what should these contain exactly?

Thanks
 
Back
Top