If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Universal Recovery Script

Universal Recovery 3.13Universal Recovery Configuration 1.3

This script will change kolMafia's default healing functions to make the most of your available items in hardcore/ronin or make the most of your meat if you have access to the mall. That makes this a great restoration improvement for both ascenders and farmers.

Once installed, mafia will use this script to restore with. It does not require the user to ever call it explicitly. Just install it and forget it, assuming it will be there to take care of you. After installation, configuration only requires you to set the healing targets in mafia's HP/MP usage tab just as when you set up mafia's restoration settings.

Distribution has migrated over to SVN. To install this script, with a current daily build, please copy/paste the following line into KoLmafia's CLI and press enter:

Code:

svn checkout https://svn.code.sf.net/p/mafiarecovery/code/

Then in the gCLI type:

set recoveryScript = Universal_recovery

This is character specific so you'll have to set recoveryScript for every character who uses the script. If you ever want to turn the script off again, use the gCLI command: set recoveryScript =

To configure options from the relay browser, you are able to call up a user interface from a drop-down menu from the relay browser's top menu.

Options: This script will allow you to customize its healing in hardcore or ronin by making use of the user interface options from the relay browser's top menu or the equivalent options in KolMafia's HP/MP usage. When the mall is available it will anything and everything to heal. Anything not listed in the relay browser's user interface will be used whenever the script decides. The user can feel free to use either the relay browser's interface for recovery options or the mafia interface. They both work. However there are also several options for this script that are only accessible through the relay browser.

The script has two different healing modes, based on the character's access to the mall.

Hardcore Mode: For hardcore before freeing the king or in normal core before breaking Ronin. This mode will treat inventory as if it was precious, always attempting to heal with the minimal items, never wasting any inventory since it is hard to replace.

Mallcore Mode: For Casual Ascension, after breaking Ronin or in hardcore after freeing the King and gaining mall access. In this mode, Universal Recovery will do whatever is most profitable. It will use the method of recovery that costs the least meat. It will check current mall prices (once per session) and purchase the items that have the best healing for their value. It will even balance the cost of restoring 20MP to cast Cannelloni Cocoon vs the cost of a scroll of drastic healing (and other HP healing items) and use the cheapest method. It will not use any more expensive restoratives in your inventory, as it assumes they would be sold in your store since you can make more meat that way.

The script will obey mafia's preferences, so if you have it set to not purchase from the mall or NPC stores, then it will avoid that. Alternately, using the optional relay browser user interface, you can instruct the script to refrain from using the mall or NPC stores.

If this script cannot purchase from the mall, it will stay in hardcore mode.

Changelog

version 3.9.4 March 31, 2011
- Need to recover at the hidden temple now.

version 3.9.1 August 29, 2011
- extra checks to prevent purchase in Way of the Surprising Fist

version 3.9 August 19, 2011
- Will only use medicinal herbs to fill up the extra 3 spleen if you have a spleen familiar and are in ronin/hardcore. If you have mall access it will still use your entire spleen as before
- Turn off all purchases during "Way of the Surprising Fist"
- add option to script controlled by relay_Universal_recovery v1.2
-- Enable purchasing during "Way of the Surprising Fist"

version 3.891 July 23, 2011
- Fixed small bug.
- Medicinal Herbs given greater precedence if you approve of using them.

version 3.89 July 5, 2011
- Fixed critical restoration bugs that sometimes affects people with a healing skill, but not cannelloni cocoon or other full heal. Why did nobody ever report this problem clearly!?

version 3.883 May 22, 2011
- Bees Hate medicinal herbs.

version 3.882 May 18, 2011
- Bees Hate plump juicy grubs.

version 3.881 May 18, 2011
- Bugfixes for both of the previous releases!

version 3.81 March 1, 2011
- Fixed bug with using MMJ when you can't buy any and are running out.

version 3.8 February 24, 2011
- Include Nemesis final battle as a multi-state battle to avoid healing in the middle of.
- Handle bad status effects to encourage players to turn off mafia's "auto-remove malignant status effects."
- Refuse to use Hot Tub when you're in the Slime Tube. (You probably want to ration that.)

version 3.79 February 17, 2011
- KoL changed the dispensary. This update requres r9054 or better.
- Will not try to heal between stages of Ed the Undying or the Naughty Sorceress.

version 3.78 January 13, 2011
- fixed stupid idiot error with last release.

version 3.77 January 12, 2011
- Checks for presence of spleen familiar before assuming spleen consumption (for some people's improved Hot Tub usage).
- Executive Narcolepsy allows a free rest.
- Fixes healing in "no heal zones" such as the hidden temple when it is a fighting holiday like FoB or you have a hipster equipped.

version 3.76 August 12, 2010
- Fixed bugs with using the sofa to rest.

version 3.75 August 7, 2010
- Fix a bug for restoring HP with resting costing an adventure, when you don't have an adventure.

version 3.7 May 11, 2010
- added options to script controlled by relay_Universal_recovery v1.1
-- Option to use inventory in mallmode (not recommended!)
-- Option to use disco rests even when Hp or Mp are not fully restored
-- Added buttons to restore HP or MP
- less complaint about not opening guild store for mmj if character is a level 9 AT
- fixed bugs where plump juicy grubs might not be used as a priority
- fixed bug where it restored mp to cast a healing skill, even when the player has no healing skill
- fixed bug which caused items to be used even though it would be followed by a full heal
- small error in CLI feedback

version 3.6 April 13, 2010
- Adds UI for preferences in relay browser: relay_Universal_recovery v1.0
- Makes use of new price sharing list at kolmafia.us
- Improved checks for meat per mp to update when access to lab or mmj is achieved
- Fixed cases where cost of restoring MP for a healing spell could be higher than cost of purchasing HP with meat

version 3.532 March 8, 2010
- Fixed version update bug

version 3.532 March 4, 2010
- Fixed seltzer bug

version 3.53 March 1, 2010
- Lots of bugfixes
- Several recovery logic improvements
- Moved all logic out of main so that it can be used as an included function in other recovery scripts
- If auto Olfacting, it will ensure you have enough MP for the job, regardless of restoration settings

version 3.52 January 4, 2010
- Fixed meat per mp bug on first run

version 3.5 December 23, 2009
- Calculates meat per mp and hp for assistance to other scripts such as zarqon's SmartStasis
- Refrains from stockpiling antidotes until level 5
- If mafia set to "do not recover hp", then it won't recover from Beaten Up
- Refrains from using Nun healing for HP if it would need to use Cannelloni Cocoon or a scroll of drastic healing afterwards
v3.51 bugfix

version 3.41 October 19, 2009
- removed special location handling because it is unreleased to recovery
- fixed for compatibility with daily build r7751+
- bug with nun recovery fixed
- tiny program improvements that make me happy

version 2.9 June 3, 2009
- Uses a free pull to get the VIP Lounge Key from Hangks for you.
- Fixes mmj use for Accordion Thieves
- Will allow you to designate characters using up stock of MMJ in aftercore, even if it cannot be purchased.
v2.91 (June 10) - Price protection
v2.92 (June 10) - More improvements to price protection and dynamic repricing
v2.93 (June 10) - Bug fixes and recovery logic improvements

version 2.8 May 25, 2009
- Hot Tub support for healing, curing poison and recovering from beaten up
- A few bugfixes and improvements
- Requires build 7310 or higher
v2.81 - Checks for Bad Moon before trying to use the Hot Tub
v2.82 - Fixed bug
v2.83 - Bug fix and recovery logic improvements

version 2.7 April 27, 2009
- Scroll of drastic healing is re-used 1/3 of the time, so now mallcore mode acounts for that in the price
- Drastically increased ability to control script functions in hardcore mode
- Will make really thick bandages from mummy wrappings if you select them in preferences
- Added ability to use Clan Sofa in case you really want to waste turns resting there
- Bug fixing
v2.71 - (May 2) Lots of Bugfixes
v2.72 - (May 4) More Bugfixes

version 2.5 April 21, 2009
- Fixed compatibility with KolMafia revision 7185
- Lots of bugfixes
- Removed vestigial maps left from before switch was implemented, to increase speed
- Updated mapfile to speed up processing speed by pre-calculating average healing
- Some improvements to recovery logic
- Allow a small amount of wastage to save meat costs
v2.51 - Bugfix

version 2.4 April 7, 2009
- Considers effect of automatic equipment switching on MP cost of skills.
- Will prevent automatic equipment switching into Brimstone Bracelet if it will lower max HP too much.
- Fixed recovery logic for cases when HP target is 100% of max HP, to allow for wasted restoration.
- Fixed round up error causing script to recover at low HP/MP, when set to not recover.
- Knows when to purchase extra seltzer for next time, to save time from excessive outfit switching.
- Less stubborn about HP restoration to save meat.
- More options are configurable.
v2.41 - bugfixes and faster mp cost computation
v2.42 - one more annoying bugfix
v2.43 - bugfix/logic and speed improvement
v2.44 - (April 9) Will check to see if you can purchase mmj before buying any
v2.45 - (April 12) "No healing skills" bug found by palpitations and fixed.

Version 2.3 - March 31, 2009
- Some routines rewritten for greater efficiency under KolMafia revision 7098 and 7114
- CLI output reduced. It runs much cleaner now.
- Use of birdform restoration is now user configurable.
- Will check user's preference for "Buy items from the mall whenever needed" and stay in hardcore mode if the preference is unchecked.
- Fixed unseemly preference for palm fronds and mummy wrappings when healing relatively few MP/HP.
- Configurable variables moved to the top of the script.
- A few miscellaneous improvements to restoration logic.

Version 2.2 - March 20, 2009
- Made scented massage oil use configurable by user
- Improved logic for comparison of otter to walrus for healing "beaten up"
- More improvements to mallcore mode
- Made some algorithms tidier: improving clarity AND reducing script length.
- (March 22) Bugfix
- (March 23) Won't use last SGEEA for "beaten up" if you haven't identified the potion of teleportitis.

Version 2.0 - March 3, 2009
- Hardcore_recoveryScript is now Universal_recovery.
- Much of the code has been rewritten.
v2.01 - Fixed Medicinal Herb's medicinal herbs use in mallcore mode.
v2.02 - Fixed usage of palm fronds, mummy wrappings and six-packs of New Cloaca-Cola.
v2.03 - A couple of small, but very important fixes
v2.04 - Minor parenthesis issue.

Formerly known as the Hardcore Recovery Script, the name has been changed since it is no longer optimized exclusively for hardcore. You'll find the changelog for version 1.0 to 1.99 in that thread.

Early discussion of this script's development was in this thread. For a long time after that it was developed in another thread as a Recovery Script for Hardcore. While I am extremely happy with its current abilities, I am always eager to hear comments and suggestions for improvement. I'd love to hear what feature you think it needs next.

Oh. Yeah. I'm going to have to make it check for spleen if you're in mallcore mode. Unfortunately I never use them so I forgot to make it check that in mallcore mode, like it already does in hardcore mode. You're really good at spotting my bugs. I like that.

That's such an easy fix I've already uploaded v2.01 right now! If any of the 8 previous downloaders want to heal with Medicinal Herb's medicinal herbs then download the update, otherwise ignore it.

Great work otherwise, interesting to watch it try to decide what to get

Originally Posted by StormCrow42

I think that's fun to watch also. I wonder if widespread use of my script amongst farmers would make a notable difference at keeping restorative prices proportional to how much they heal.

By the way, since my script now tries to make use of the Platinum Yendorian Express Card, if anyone actually has one of these, please let me know if the script uses it.

The heuristic it uses, is that it will try to heal with the Express Card if your mp is below autoheal levels and also below 1/9 of your maximum mp. So, get your MP down that low and please tell me if it works. I doubt I'll ever own one so I can't test this myself. Also, if that heuristic doesn't match your own preferences, please tell me so I can make it better suit someone who actually owns one.