Universal Recovery Script

I hate it when Bale steps in and removes my malignant effects. That should be MY choice, not Bale's.

:P

Speaking as a malignant's rights activist, I concur. I should have my malignant effects if I want them. In all seriousness, the script removing negative effects now is great. Thank you so much for saving me meat with this script. Bale is awesome.
 
I've noticed in the last week or two that _meatpermp is sometimes set to a ridiculously low value.

Found the bug. It was the direct result of fixing a previous bug. Now both bugs are fixed.


Universal recovery v 3.84 released!


Changelog:
version 3.84 March 22, 2011
  • Fixed meat per mp calculation
 
Last edited:
I've used UR a few times in the past, but was never happy with how it functioned in HC. Is there a way to tell it to never let my meat drop below X? Or when it results to buying HP, to have it heed my requests to not use Ailment Ointments and the such(which it doesn't seem to check when in that phase)?

Also, is there a way to force it to abort if cure beaten up fails? I see that cure_beaten_up returns false if it does not work, but restore never actually checks the return values. I don't know if I'm missing something or if it's being handled somewhere else, but this is driving be a bit bonkers as well.

Thanks!
 
That won't change aborting on still being beaten up. That will only cause an abort if you fail to make your restoration target.
 
So, the change that shazbot needs to make to personal copy would be changing this line
Code:
cure_beatenup(objective);
(which does appear twice) to this line:
Code:
if (!cure_beatenup(objective)) return false;

Though that does make it stop trying to restore automatically at all, if it can't cure beaten up... it's more complicated if you still want it to heal up the rest. :)
 
Though that does make it stop trying to restore automatically at all, if it can't cure beaten up... it's more complicated if you still want it to heal up the rest. :)

Yup. I've been considering the issue since his post. Maybe I should add such an option. Thinking about it... Slowly.
 
Restoring HP! Currently at 33 of 158 HP, 8 of 298 MP, current meat: 175 ... Target HP = 158.
In mallmode, best HP restorative is: really thick bandage @ 204.54546 meat total.
Trying to use 2 really thick bandage
Running out of meat! Time to take some out of the closet...

Requests complete.

baleUr_AlwaysContinue => true

I was kind of hoping that baleUr_AlwaysContinue being true would trigger some kind of Plan B whereby UR tried to heal using some other means, including rests. Is this an error with my expectations?

P.S.

Same character, later in the day.
Restoring MP! Currently at 68 of 159 HP, 42 of 298 MP, current meat: 15 ... Target MP = 90.
In mallmode, best MP restorative is: ancient Magi-Wipes @ 165.81818 meat total.
Trying to use 1 ancient Magi-Wipes
Running out of meat! Time to take some out of the closet...

I have everything checked as an MP restore in the rather short list displayed by the Universal_Recovery relay script and almost everything checked in mafia's corresponding list. There are several MP restoring items that are checked there and currently in my inventory, so again I wonder why it does not do something.

Prefer using inventory is not checked.

Suggestion - if this is a case where UR refuses to use something because there would be a meat gain by selling something else and buying something, it would be nice to have a debug or verbose mode that would tell the player what that item is.
 
Last edited:
I was kind of hoping that baleUr_AlwaysContinue being true would trigger some kind of Plan B whereby UR tried to heal using some other means, including rests. Is this an error with my expectations?

Yes, it is an error in your expectations. Consider the following: How should Plan B be defined? Should everyone have the same Plan B? If you're willing to spend adventures healing why don't you give permission to rest in your campground since that is always checked for LAST. That is always Plan B if you give the script permission.


Prefer using inventory is not checked.

Suggestion - if this is a case where UR refuses to use something because there would be a meat gain by selling something else and buying something, it would be nice to have a debug or verbose mode that would tell the player what that item is.

Sigh. I don't want to have to sort through your inventory to find an item that you can use, just to tell you that my script isn't using it. Seriously? This only happens because you want to keep your meat closeted in aftercore and don't want to tell my script to use up your inventory. If that's how you want to play then... I don't know what to say.
 
Ref Plan B above - Ignoring things like user error and the occasional data file that doesn't contain what I thought it contained, UR was certainly allowed to rest and it chose to abort instead. Clearly I need to reproduce this or apologize for operator error. In a related "which Plan B?" it definitely aborted because it failed to restore MP even thought there were 100+ Mountain Stream Sodas in my inventory and it was checked as a restore.

In fact as I was typing, the problem reoccurred, so I will dump data in hopes of gleaning understanding.

gCLI Output
Code:
Restoring MP! Currently at 126 of 130 HP, 14 of 309 MP, current meat: 50 ... Target MP = 93.
In mallmode, best MP restorative is: ancient Magi-Wipes @ 287.2727 meat total.
Trying to use 2 ancient Magi-Wipes
Running out of meat! Time to take some out of the closet...

Portion of preferences file with variables that start with bale
Code:
baleUr_AlwaysContinue=true
baleUr_BirdThreshold=0.1
baleUr_DontUseHotTub=false
baleUr_HPtrouble=false
baleUr_MPtrouble=false
baleUr_Purchase=1
baleUr_UseInventoryInMallmode=false
baleUr_UseMmjStock=false
baleUr_Verbosity=2

mp autorecovery section of preferences
Code:
mpAutoRecovery=0.1
mpAutoRecoveryItems=platinum yendorian express card;sleep on your clan sofa;rest at your campground;free disco rest;galaktik's fizzy invigorating tonic;visit the nuns;oscus's neverending soda;natural fennel soda;bottle of vangoghbitussin;monstar energy beverage;carbonated soy milk;carbonated water lily;nardz energy beverage;blue pixel potion;bottle of monsieur bubble;ancient magi-wipes;unrefined mountain stream syrup;phonics down;tonic water;palm-frond fan;honey-dipped locust;green pixel potion;knob goblin superseltzer;tiny house;dyspepsi-cola;cloaca-cola;mountain stream soda;magical mystery juice;black cherry soda;knob goblin seltzer;cherry cloaca cola;soda water
mpAutoRecoveryTarget=0.3

carbonated soy milk, seltzer and super seltzer, mmj and soda are in inventory in various quantities. What is lacking is meat because all but 50 are in the closet.

So with the situation as above, I want UR to restore mana with soy milk, seltzer or any of the other items listed above and continue and instead it aborted. Is there any setting I should change to get what I want?

Is there any possibility that a failure to buy in MallMode is not properly triggering a try something else action?

I'm not sure I understand your comment about meat and aftercore. I have poor characters and suboptimal play and numerous situations where I would rather spend adventures healing than meat because my next step requires more meat than I have on hand. At one point closeting meat was a viable strategy to keep EatDrink and UR from spending everything I had.

Thanks for your patience.
 
I'm not sure I understand your comment about meat and aftercore. I have poor characters and suboptimal play and numerous situations where I would rather spend adventures healing than meat because my next step requires more meat than I have on hand. At one point closeting meat was a viable strategy to keep EatDrink and UR from spending everything I had.

I suspect that using those adventures to get meat (farm the castle - that should get you 500+ meat per adventure even with very basic setup) would get you enough meat to heal *and* have more meat after that than before.

Of course, maybe not doing that is what you mean by "suboptimal"?
 
@Theraze I presume that preference is the one set by "Prefer using inventory instead of mall, regardless of value" in the UR GUI? Maybe the problem is English as a First Language. I would translate that to mean, if checked, that if something were available in my inventory it would be used without regard to what the mall price of the same item is. I do not, however expect that preference to cause restoration to fail unless there are no items in inventory or available in the Mall. My hope for AlwaysContinue is that UR would never abort unless all three of the following are true:

  • MP, HP or both were not restored to the requested settings.
  • There are no appropriate restoration items available from the Mall with availability determined by meat on hand and various UR and Mafia preferences.
  • There are no appropriate restoration items available in inventory.

My suspicion is that one of the above is not being observed but I don't know if that is a design choice by Bale or what.

@xKiv - point taken but my goal is 100% automation. I'll also note that it happens most often at levels where the Castle is not available.
 
Ah, true, regarding the mallmode preference. That sets inventory stuffs to a value of 1, so it'll burn that down first.

Actually *gasps* opened the script and looked at the code. Do you have auto satisfy with mall/NPC disabled? If so, and you want UR to purchase, the preference you may want to change is baleUr_Purchase... 1 means use your mafia preferences, 2 means use NPCs, 3 means use the mall.

Also, AlwaysContinue means never abort. That means that when you're unable to reach step one in your fail-bit for any reason, don't abort... the rest of it is dependent on your other settings. Else it wouldn't really be an always, but more like a SometimesContinue value. Which wouldn't be especially useful in terms of running headless.
 
Last edited:
@Theraze I presume that preference is the one set by "Prefer using inventory instead of mall, regardless of value" in the UR GUI? Maybe the problem is English as a First Language. I would translate that to mean, if checked, that if something were available in my inventory it would be used without regard to what the mall price of the same item is.

Yup, that is what it does.

I'm thinking a bit more about baleUr_AlwaysContinue. There are some reasonable ways to make it more proactive about using up resources. Right now it will refuse to waste anything. I'm thinking that it might not be unreasonable to allow the character to waste stuff if that preference is checked. That would be a Plan B. Does that sound reasonable?
 
Right now it will refuse to waste anything. I'm thinking that it might not be unreasonable to allow the character to waste stuff if that preference is checked. That would be a Plan B. Does that sound reasonable?
Yes. I think the disconnect between my expectation and your code is that I expect to sacrifice efficiency for automation whereas that is not happening. Thank you for considering this.
 
Back
Top