Universal Recovery Script

Bale

Minion
That's why KoLmafia has the option to untick "Auto-remove malignant status effects." Do that and it won't remove status effects any more. This script will remove the status effects that are a real problem so you shouldn't have a problem.
 
As a data point, I've had to top using UR in aftercore for the same reasons mentioned a few posts back. UR is for some reason burning through items in my inventory instead of cocoon, and I haven't found a way to get it to not consider anything in my inventory.
 

Crowther

Active member
As a data point, I've had to top using UR in aftercore for the same reasons mentioned a few posts back. UR is for some reason burning through items in my inventory instead of cocoon, and I haven't found a way to get it to not consider anything in my inventory.
So, don't leave us wondering. Do you have it configured to treat your inventory as free? I've recently been playing on three very different accounts and UR has always been extremely close to optimal. Even during Crimbo when prices and such were changing rapidly and I was healing lots.
 
"Prefer using inventory instead of mall, regardless of value" is not checked, and "Allow recovery to purchase restoratives?" is set to "Never." After searching, these are the only settings in mafia or UR that seem to be relevant to what you're mentioning. I double checked UR preferences and the general and item acquisition of mafia's preferences.
 

Crowther

Active member
"Prefer using inventory instead of mall, regardless of value" is not checked, and "Allow recovery to purchase restoratives?" is set to "Never." After searching, these are the only settings in mafia or UR that seem to be relevant to what you're mentioning. I double checked UR preferences and the general and item acquisition of mafia's preferences.
I'm not familiar with the effects of not allowing purchases. One last guess. Is it possible that you don't have any cheap MP restorers left in inventory, so your meat per MP value is high enough to make cocoon more expensive than the HP restorers UR is using? Prices for MP restorers are a bit higher than normal since Crimbo. My _meatpermp value is 3.28 right now on a level 17 AT.
 
This isn't a new thing, so I can't speak to every circumstance, but I did test it while running my mimic in Dreadsylvania just now, perpetually having oodles of MP. It didn't try to use cocoon, it went to items in my inventory. Turning on purchases made it go to scrolls of drastic healing in the mall over cocoon.
 

Crowther

Active member
This isn't a new thing, so I can't speak to every circumstance, but I did test it while running my mimic in Dreadsylvania just now, perpetually having oodles of MP. It didn't try to use cocoon, it went to items in my inventory. Turning on purchases made it go to scrolls of drastic healing in the mall over cocoon.
I'm stumped. Just to be sure, I just checked my character and UR used cocoon to restore HP.
 
I frequently ran into scenarios a few weeks ago where it would use a couple free rests and then use a couple magi-wipes to restore HP, when it restored enough MP with one of the free rests to cast cocoon (I had a house and a pagoda).

It really didn't make much sense to me to do that. I don't have any debugs of that behavior but it was just really odd compared to what I would have done. I don't understand restoring enough MP to cast a full heal and then continue to restore HP with items and use up 2 free rests as well.
 

Crowther

Active member
I frequently ran into scenarios a few weeks ago where it would use a couple free rests and then use a couple magi-wipes to restore HP, when it restored enough MP with one of the free rests to cast cocoon (I had a house and a pagoda).

It really didn't make much sense to me to do that. I don't have any debugs of that behavior but it was just really odd compared to what I would have done. I don't understand restoring enough MP to cast a full heal and then continue to restore HP with items and use up 2 free rests as well.
I believe I fixed that by removing magi-wipes from restoring HP. You really don't want any dual HP/MP restorers used for their HP side.
 

Qualidus

New member
For the people encountering issues with it restoring from the inventory first in aftercore, do you allow any mall purchases at all? If UR is set to never purchase restoratives, it will not use its mallcore mode [either through Mafia or UR settings].

I had a multi that was running with this and was also stymied when the script basically used up every HP restorer in my inventory even though I had disabled every one that I could and had cocoon and more than enough MP to be efficient in aftercore.

However, I don't like any automated purchasing from the mall, so I have this disabled. This prevented UR from using its mallcore mode and instead reverted to HC mode (even though I'm in aftercore).

Other UR settings: Allow recovery to Purchase restoratives: KoLMafia preference (allow NPCs, disallow Mall). Prefer using inventory instead of mall: unchecked.
Configurable HP restores: Nothing checked in UR relay, Cocoon and Walrus checked in Mafia
Configurable MP restores: Nothing checked in UR relay, Free disco rest, Tonic, nuns, Monsieur Bubble, phonics down, Superseltzer, Mountain Stream Soda, MMJ, Seltzer, Cloaca Cola, soda water in Mafia

The Mafia settings for items shouldn't matter as I believe UR ignores them all.

Code:
boolean mallcore = can_interact() && buy_mall && (my_ascensions() > 0 || my_level() > 4);

In HC mode the following priorities take effect from the comments:
// This restores hp. Firsts it cures beaten up. To heal hp it uses (in order):
// First nuns if completed as hippy, then from inventory, then skills, finally purchasing as necessary.
// Skills are after inventory because they consume a more valuable resource: mp

If the inventory can fully heal (which is likely in aftercore), then consume all the inventory items because inventory is less valuable than MP in HC.

It seems like in HC mode, inventory essentially has a built-in cost of 0 meat as long as UR determines that there are enough items to restore HP to the desired amount.

A workaround for this would be to enable mall purchases and set the buy limit to a very low value. This does have the side-consequence of not being able to purchase anything with "buy" anymore.

A different workaround would be to set URs recovery setting to purchase freely which should trick it into mallcore mode.

Perhaps it'd be better to change how mallcore is defined and perform the buy from mall check prior to actually purchasing an item?

This way the cheapest logic can be applied to the worth of the existing inventory weighted against skills and mp restorers. This might have the inadvertent side effect of either acquiring lots of NPC purchased items (ie ointment) if enough weren't on hand or worse using the tonic if all other options were unavailable. Although UR does provide more fine-grained control over these items so they could be disabled and UR would just fail.
 

Theraze

Active member
Not true... buy will override ANY auto-limits. Tell it to buy 1 antique accordion before you unlock the shop, and repeat 5-10 times? Don't worry... that 7 million meat accordion that you now have in storage will comfort you with its dulcet tones.

If you want buy to respect its limits, you need to either use obtain/retrieve_item or use the 3 parameter ASH variant that will allow you to set a max buy price.

If you set your aBPL to 1000, it only affects obtain/retrieve_item. It doesn't change the behaviour of 'buy' in the slightest...
 

fronobulax

Developer
Staff member
Not true... buy will override ANY auto-limits. Tell it to buy 1 antique accordion before you unlock the shop, and repeat 5-10 times? Don't worry... that 7 million meat accordion that you now have in storage will comfort you with its dulcet tones.

It warms the cockles of my heart to know that someone remembers my misadventures and grief. :)
 

Bale

Minion
Thanks for pointing out that I need to do something. Since this stupid script is on svn you'll find the update in the usual way.
 

fronobulax

Developer
Staff member
With the new Script Manager, I thought I would go through and delete things mafia thought I had in SVN that seemed to be duplicates or OBE. In the process I failed to recognize "mafiarecovery" as being Universal Recovery and friends, so deleted it. Just sayin' for the benefit of anyone else who might be obsessively trying to clean things up and fails to remember that UR is deliberately downplaying the fact that it available via SVN.

:)
 

fronobulax

Developer
Staff member
UR is available through the Script Manager now. :(

Your creation, Universal Recovery, has a life of its own. It will never die. The best you can hope for is that after an attempted death of UR, 1 UP will rise, phoenix like, from the ashes.
 
Top