Universal Recovery Script

Bale

Minion
Just a note.

sugar shards have been added as a recovery item.

This script will now use them when appropriate. You will not need to update this script or its data files since they will update the data automagically. However, unless you are using a recent build of kolMafia, it will not recognize the item.
 

halfvoid

Member
i was just about to ask that as i'm soon to purchase my tome of sugar shummoning.

do you know if you can use all tomes 3 times a day each

or

just 3 total tome summons a day?
 

Spiny

Member
Bale,

In reading the thread on the demons script and in recent explorations into the wossname.ash script, I'm scratching my head in regards to retrieve_item(). As you know we have that line in my copy of the script modified from

Code:
boolean mallcore = mall && can_interact() && get_property("autoSatisfyWithMall").to_boolean();

to

Code:
boolean mallcore = mall && can_interact();

I guess my question is what is affected by this change exactly?

Here's why I ask. When your script wants anti-anti antidotes, it uses retrieve_item() which I believe is the same as CLI command acquire. What I see in my CLI at those times is a message saying that I need x# of them to continue. I have to manually get them, or the script keeps looking for them, because I have mafia settings set to not buy from mall and not buy from npcs. The buy command buys whatever regardless of mafia's preference to buy from npc/mall. So what exactly is the change we've done in the script doing? :) This is more of a curiosity question than an OMG have to fix something sort of thing.

Thanks,
-Spiny
 

Bale

Minion
So what exactly is the change we've done in the script doing?
You're allowing it to purchase restoratives from the mall despite your mafia's settings. (Even though it won't purchase antidotes, this allows it to purchase items that restore HP or MP.)

It had not occurred to me that the antidote line was generating an error for people who disallowed mall purchase. That's a bug since they shouldn't have to be subjected to the error message.
 

codster62

Member
Wow! A very nice script. I was getting tired of Kolmafia's default healing system fail on me, and I remembered your auto-recovery script. I have to say, it definately beats kolmafia's healing system. ;) Plus, it buys good cheap healing items. ;)
 

shoptroll

Member
Not sure if this is a bug or not, but the script is opting to buy MMJ even though I have sugar shards in my inventory right now. Currently level 7 in a HCB PM run. Sugar shards are checked off for both HP and MP restoration in Mafia. Just looking for some clarification as to why this behavior is happening.
 

Spiny

Member
Sugar shards restore more hp than mp. MMJ restore far more mp than shards do with a single use. I'd presume you have a healing skill you can use, possibly cocoon? That breaks down to a mana cost to cast of 20 mp, which would be 1 MMJ for 100 meat or possibly 4 sugar shards at 200 each. In short, MMJ is more cost effective in the long run.

Oh, HC BM lv 7... so you're using lasagna bandages... still same logic would apply I'd guess. At least that would be my preferred option.

But Bale will probably have a response that is more sound than my off the top of the head guess ;)
 
Last edited:

shoptroll

Member
Right now I'm needing very minimal HP restoration so it seemed weird that it wasn't trying to use up items I had on hand before picking up MMJ from the store. But what you describe makes sense and I just needed a little clarification. Thanks!
 

Bale

Minion
It is because you need minimal HP restoration. Since sugar shards restore both HP and MP, in hardcore it tries not to waste anything, so it is holding on to those until the HP restoration is useful.

Spiny's answer is based on aftercore logic.
 

Muhandes

Member
The script used my one before last scented massage oil. I thought they are kept untouched? Or did I get this wrong?
Also, bought MMJ instead of using tonic water which I had 50 of (doing HCO and making 10 a day).
 

Bale

Minion
Scented massage oils are only untouched if they are un-checked in preferences.

recovery_options.png

Also, bought MMJ instead of using tonic water which I had 50 of (doing HCO and making 10 a day).
That sounds odd to me. I assume you're still in hardcore at this time. (Correct me if I'm wrong.) Can you send me some more information, like a session log of the event so I can try to figure out why it would do that?

The only circumstance I can think of where that would be correct is if you could only restore a tiny bit of mp, so it would buy mmj rather than waste half of your tonic water on a maxMP that is too low. Was that the circumstance? Hopefully the session log will reveal the answer.
 
Last edited:

shoptroll

Member
It is because you need minimal HP restoration. Since sugar shards restore both HP and MP, in hardcore it tries not to waste anything, so it is holding on to those until the HP restoration is useful.

Spiny's answer is based on aftercore logic.

Gotcha. Since I have lasagna bandages, cocoon and tongue of the walrus I'm probably not going to see the shards used by the script, right?
 

Bale

Minion
Not necessarily.

In hardcore it will give preference to using items to restore whenever it can. You'll probably see them used eventually. Probably sometime when you need mp and you're also down 20 hp you'll note it being used. Or maybe some time when both HP and MP are quire low you'll see the shard consumed so that you can cast tongue of the walrus.

Often I see items consumed at times that make me very happy. Other times I decide that it is a good time to assume manual control. My algorithms and procedures in this script aren't perfect, but they do work more often than not.

If you can clearly describe the logic that you use for healing, I'd probably incorporate it into my script if I can figure out how to reconcile it with the existing framework. I'm always trying to make this better.
 

Spiny

Member
Here's a good example of me explicitly calling Bale's script to restore both hp/mp while in HC on a DB run. I have Tongue of Walrus, but no other heal skills. This used a sugar shard in its restoring:

Code:
> restore both

_BalesUniversalRecovery => 3.334
198 prices updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap
0 prices updated from http://nixietube.info/mallprices.txt
Pricelist updated.
Restoring HP! Currently at 53 of 113 HP, 42 of 124 MP... Target HP = 113, current meat: 21316.
Restoring MP! Currently at 53 of 113 HP, 42 of 124 MP... Target MP = 72, current meat: 21316.
Try to heal MP from inventory.
Using 1 Nardz energy beverage...
You gain 51 Mojo Points
Finished using 1 Nardz energy beverage.
Try to heal HP from inventory.
Using 1 tiny house...
You gain 24 hit points
You gain 20 Mojo Points
Finished using 1 tiny house.
Using 1 Doc Galaktik's Homeopathic Elixir...
You gain 20 hit points
Finished using 1 Doc Galaktik's Homeopathic Elixir.
Using 1 sugar shard...
You gain 13 hit points
You gain 7 Mojo Points
Finished using 1 sugar shard.
Restoring MP! Currently at 110 of 113 HP, 120 of 124 MP... Target MP = 124, current meat: 21316.
Try to heal MP from inventory.
Last attempt to purchase MP with meat.
Visiting Doc Galaktik...

Restore 4 MP at Doc Galaktik's
You gain 4 Mojo Points
Cure purchased.
 

bumcheekcity

Active member
Bale, I was in the mine in disguise and kept getting beaten up, and the script used up all my hottubs. Weird because it used to heal me to 1HP via galaktik....

Using version 13.6.
 

Muhandes

Member
The only circumstance I can think of where that would be correct is if you could only restore a tiny bit of mp, so it would buy mmj rather than waste half of your tonic water on a maxMP that is too low. Was that the circumstance? Hopefully the session log will reveal the answer.

I browsed through the log and discovered the source of (my own) confusion.
The MMJ was bought as combat restorative, on the same instance when some tonic water was used to actually do the restoring. Sorry for the bother.
 

Bale

Minion
That's a relief to know it was a misunderstanding.

Bale, I was in the mine in disguise and kept getting beaten up, and the script used up all my hottubs. Weird because it used to heal me to 1HP via galaktik....
I can't imagine why. It shouldn't possibly be able to do that. Could I see this in a session log so I can learn something?

Edit: Actually I can see this happening if you were to explicitly instruct it to gain a specific amount of HP or use the restore hp command instead of relying on default healing. If you do this, it will assume you are serious about wanting your HP healed and behave appropriately.
 
Last edited:

ziz

Member
How very strange, this. In BM, as a seal clubber (tongue of the otter, no other healing skills), not beaten up; effects in place are missing kidney and 279 turns of Seal Clubbing Frenzy. I'm using the latest (SVN) Mafia and universal recovery 3.334.

> autosell facsimile dictionary

Autoselling items to NPCs...
You gain 21,337 Meat
Items sold.
(note: here I hit the '1' shortcut button to restore hp)
Restoring HP! Currently at 73 of 196 HP, 50 of 82 MP... Target HP = 196.
Buying medicinal herb
Purchasing Medicinal Herb's medicinal herbs (1 @ 100)...
You acquire an item: Medicinal Herb's medicinal herbs
Purchases complete.
Using 1 Medicinal Herb's medicinal herbs...
You gain 123 hit points
Finished using 1 Medicinal Herb's medicinal herbs.
Casting Tongue of the Otter 1 times...
You gain 16 hit points
Tongue of the Otter was successfully cast.

It hasn't cast Tongue other times I've just needed to heal up with medicinal herbs.

I've put verbose and super_verbose on in case it happens again.

Edit: Yep, it happened again, though verbose and super_verbose aren't extremely informative. Just finished a combat (in which I barely survived, blasted cuncatitis) and the auto-heal triggered.

Calling Universal Recovery for type=HP, amount=182
Restoring HP! Currently at 14 of 196 HP, 45 of 82 MP... Target HP = 196, current meat: 22073.
Trying to fullheal
Buying medicinal herb
Purchasing Medicinal Herb's medicinal herbs (1 @ 100)...
You acquire an item: Medicinal Herb's medicinal herbs
Purchases complete.
Using 1 Medicinal Herb's medicinal herbs...
You gain 182 hit points
Finished using 1 Medicinal Herb's medicinal herbs.
Casting Tongue of the Otter 1 times...
You gain 18 hit points
Tongue of the Otter was successfully cast.
Calling Universal Recovery for type=MP, amount=0

Recovery settings are: stop if auto-recovery fails; Auto-recover health at 25%; try to recover up to 100%. HP recovery options checked: free disco rest; Nostrum; herbs; scroll of drastic; visit the nuns; filthy poltice; gauze garter. Aside from changing verbose and super_verbose to true, I haven't changed any UR options.
 
Last edited:
Top