Universal Recovery Script

Razorsoup

Member
Hey Bale, first I would like to thank you for the Recovery Script. I like it a lot. Next, I'd like to gracisouly complain about a feature, the reserve. For whatever reason, the script likes to reserve random things to use as combat restoratives. I am not sure why it does this as my current reserve settings are the default as seen here
Code:
 item reserve = null;		// This is a spare mp restorative kept for combat use.
item reserve_purch = null;	// In addition, some knob goblin seltzers or mmj may be held in reserve.
int  reserve_num = 0;		// Hold this many of them.
Despite this, it continues to buy 30 Goblin super seltzers and 30 bottle of Monsieur Bubble, neither of what I want or need. Is there some setting that I am overlooking that is causing these purchases? As of now, I just put a return command at the beginning of the reserve functions, hoping this will prevent any random reservations =\.

As best as I can tell, those aren't settings. That bit of code you copied seems to be UR initializing variables that it later changes to whatever it determines is the best option. I'm not sure if there is a way to stop UR from keeping restoratives in reserve and I'm a little unclear as to why one would want to stop it.
 

Bale

Minion
What is "null"? This is ASH, not Java.

Null is a constant previously defined in the script. There was a reason I didn't use $item[none], but I cannot remember it right now.


Hey Bale, first I would like to thank you for the Recovery Script. I like it a lot. Next, I'd like to gracisouly complain about a feature, the reserve. For whatever reason, the script likes to reserve random things to use as combat restoratives. I am not sure why it does this as my current reserve settings are the default as seen here
Code:
 item reserve = null;		// This is a spare mp restorative kept for combat use.
item reserve_purch = null;	// In addition, some knob goblin seltzers or mmj may be held in reserve.
int  reserve_num = 0;		// Hold this many of them.
Despite this, it continues to buy 30 Goblin super seltzers and 30 bottle of Monsieur Bubble, neither of what I want or need. Is there some setting that I am overlooking that is causing these purchases? As of now, I just put a return command at the beginning of the reserve functions, hoping this will prevent any random reservations =\.

The value of reserve_purch is set in the function choose_reserve_purch(). You'd have to change that function to stop it from choosing an item to buy for in-combat restoration. You can easily prevent it just by taking out the guts of that funtion so it looks like this:

Code:
void choose_reserve_purch() {
}


I'm a little unclear as to why one would want to stop it.

I agree. I would be very upset if I ever got into a situation where I needed more mp in the middle of a combat, but couldn't restore since I had disabled the part of UR that buys combat restoration items. It spends very little meat for a very worthwhile cause.
 
Last edited:

Mr_Crac

Member
How can I make the script simply use Canneloni Cocoon to fully heal, and that's it?
Currently, the script does e.g. something like this:

Restoring HP! Currently at 656 of 1364 HP, 758 of 7103 MP, current meat: 4698627 ... Target HP = 1364.
Using 7 Pokëmann band-aid...
You gain 700 hit points
You acquire an effect: Aided and Abetted (duration: 70 Adventures)
Finished using 7 Pokëmann band-aid.
Did not fully restore HP for some reason.

I don't want it to use healing items, I just want one single use of CC. I am generating enough MP every turn so that the cost for using this skill is not a problem at all.
 
Last edited:

Winterbay

Active member
The absolutely easiest way to do that is to disable Universal Recovery and use Mafia's built-in one with the only option being CC.
 

Mr_Crac

Member
As a Pastamancer, I can buy MMJ for 100 meat, which at the level I am currently at (26) restores way more MP than is needed for one cast of Canneloni Cocoon. Why the script would rather choose to use healing items which cost more in the mall than 100 meat, I have no idea, but this does seem to be erroneous.
 

Mr_Crac

Member
Do you have the script set to consider items in inventory to be free?

If yes, and I do have MMJ (I have about 2,000 in my inventory) then it should prefer to use MMJ+Cocoon over other, more expensive healing methods I guess?

If no, it should prefer to buy MMJ since I can get them for a mere 100 meat as I am a Myst class. Which, together with Cocoon, makes for cheaper healing than buying/using something else.

As for your question: If the option you mean is "Prefer using inventory instead of mall, regardless of value", this is not checked in my setup. "Use MMJ in stock, even if it cannot be purchased this ascension" is checked.
 
Last edited:

lostcalpolydude

Developer
Staff member
MP is not free, even if it's super cheap, is what I would expect from the script. But with your current settings, that result doesn't seem right.
 

Mr_Crac

Member
The script keeps acting in a funny way:

Restoring HP! Currently at 777 of 1604 HP, 629 of 7244 MP, current meat: 4720904 ... Target HP = 1604.
Campground request 1 of 1 in progress...

[5373] Rest in your dwelling
You gain 78 hit points
You gain 80 Mana Points

Campground request 1 of 1 in progress...

[5373] Rest in your dwelling
You gain 78 hit points
You gain 80 Mana Points

Campground request 1 of 1 in progress...

[5373] Rest in your dwelling
You gain 78 hit points
You gain 80 Mana Points

Campground request 1 of 1 in progress...

[5373] Rest in your dwelling
You gain 78 hit points
You gain 80 Mana Points

Campground request 1 of 1 in progress...

[5373] Rest in your dwelling
You gain 80 hit points
You gain 80 Mana Points

Campground request 1 of 1 in progress...

[5373] Rest in your dwelling
You gain 80 hit points
You gain 80 Mana Points

Campground request 1 of 1 in progress...

[5373] Rest in your dwelling
You gain 79 hit points
You gain 80 Mana Points

Using 2 Pokëmann band-aid...
You gain 200 hit points
You acquire an effect: Aided and Abetted (duration: 20 Adventures)
Finished using 2 Pokëmann band-aid.
Using 1 ancient Magi-Wipes...
You gain 58 hit points
You gain 53 Mana Points
Finished using 1 ancient Magi-Wipes.
Using 1 swirly potion of healing...
You gain 15 hit points
You gain 14 Mana Points
Finished using 1 swirly potion of healing.
Recovery target reduced to healing trigger (802)to conserve meat.

Request 17 of 20 (Crimbo13: WarBear Fortress (First Level)) in progress...

Why on earth would it do that instead of one single cast of Cannelloni Cocoon? :(
Is there perhaps some setting in KoLmafia itself that I might have set wrongly?
 

Winterbay

Active member
Well it was only using items and free rests so if you've set invebtory to be considered free and your meat per mp isn't zero that Iooks fine to me.
 

Mr_Crac

Member
Well it was only using items and free rests so if you've set invebtory to be considered free and your meat per mp isn't zero that Iooks fine to me.

If my inventory is free, so is the MMJ in my inventory. So my meat per mp then is zero. Why wouldn't the script rather use those MMJ instead, and convert them to HP? Even considering the cost for MMJ, it would still be cheaper to use those than to use healing items.

This does not make any sense.
 
Last edited:

xKiv

Active member
If my inventory is free, so is the MMJ in my inventory. So my meat per mp then is zero. Why wouldn't the script rather use those MMJ instead, and convert them to HP? Even considering the cost for MMJ, it would still be cheaper to use those than to use healing items.

This does not make any sense.

It doesn't make sense because "items in my inventory are free" doesn't make much sense. You can't them both be free and at the same time have some of them cost more than others.

One problem is that you "told it" to heal by using your ("free") items, and it chose some "random" combination that still "cost" you zero (in this case, free rests, magi-wipes and pokeman bandaids from you rinventory).
Another problem is that, normally (afaik), mafia first tells the script to heal some HP, and then (separately) some MP - so recovering MP during HP healing is an extra complication.

And then, MP still has to be worth something so that the script can decide between your means to convert MP-to-HP (because all decisions are made by converting to meat value) - you wouldn't want to get that MP by using something worth (dozens/hundreds) thousands of meat (or more), you have that mmj that costs only 100 meat, right? (except that you want UR to consider them both worth zero)

tl;dr: you forced it to think that the thing it did costs zero, so mmj+coccoon was not better
 

Mr_Crac

Member
Okay, so how do I set Mafia together with this script so that it does what I want it to do?

Or do I always have to switch between either this script active, or KoLmafia's healing active?
 

Bale

Minion
This does not make any sense.

I agree, but I'm not going to try to fix it. Sorry about that. I'm particularly unmotivated to fix anything that results from assuming items in inventory are free. (That feature was added under protest and the results of using it have frequently convinced me that I shouldn't have caved in.)


do I always have to switch between either this script active, or KoLmafia's healing active?

Yup. You can only use one at a time, but you can switch between them by changing the value of recoveryScript.
 

fronobulax

Developer
Staff member
I agree, but I'm not going to try to fix it. Sorry about that. I'm particularly unmotivated to fix anything that results from assuming items in inventory are free. (That feature was added under protest and the results of using it have frequently convinced me that I shouldn't have caved in.)

OK with me if you leave it out in 1 UP. I don't remember whether I advocated for it or not but the problem that it solves for me is when a script (not just UR) makes all its decisions on meat equivalents under the assumption that the mall is available. This has not always given reasonable results in the past when a character is in HC or Ronin.
 

Mr_Crac

Member
I agree, but I'm not going to try to fix it. Sorry about that. I'm particularly unmotivated to fix anything that results from assuming items in inventory are free. (That feature was added under protest and the results of using it have frequently convinced me that I shouldn't have caved in.)

Yay we agree! :)
 
Top