Universal Recovery Script

can we have an option to buy only 1 type of mp restorer? (or hp restorer?) if there isn't enough meat to buy mmj or seltzer, it will buy doc galactik (or seltzer). This is only helpful if you autosell everything immediately, including stuffies, and even then you can do it by hand.
 
UR buys extra MP restorers you can use in combat. The number depends on the meat on hand but it will always buy the same type of restore: MMJ, or seltzer if you can't buy MMJ.

If you are talking about buying restorers to actually restore between combats, then perhaps UR isn't the script for you - use Mafia's default restore instead and only select the type of restores you want to allow.

EDIT:
for the early game, when I am paranoid with my meat and want manual control over restoration, I disable UR. This is why I have these aliases:

Code:
alias bale => set recoveryScript = Universal_recovery
alias baleno => set recoveryScript =
 
Summary: Don't use UR if you want manual control. :D UR is there to decide which is best. If you don't want it to decide, don't use it.
 
Summary: Don't use UR if you want manual control. :D UR is there to decide which is best. If you don't want it to decide, don't use it.

Well said. I also turn off mafia's automated recovery at the beginning of an ascension. However, when I do that I set my recovery settings to "do not recover" rather than telling it not to use my script. At times like that I don't want mafia to use it's own recovery methods either.
 
Well said. I also turn off mafia's automated recovery at the beginning of an ascension. However, when I do that I set my recovery settings to "do not recover" rather than telling it not to use my script. At times like that I don't want mafia to use it's own recovery methods either.

He's not talking about the beginning of an ascension - he's talking about turning it off all the time (since it does that all the time). I want it to stop using doc galactic when it has access to mmj. I don't want manual control, I just want it to work. I don't know how to explain it any better.

Summary: Don't use UR if you want manual control. :D UR is there to decide which is best. If you don't want it to decide, don't use it.
That's not well said, it's retarded. What the hell is wrong with you?
 
He's not talking about the beginning of an ascension - he's talking about turning it off all the time (since it does that all the time). I want it to stop using doc galactic when it has access to mmj. I don't want manual control, I just want it to work. I don't know how to explain it any better.

That's not well said, it's retarded. What the hell is wrong with you?
UR is supposed to calculate what's cheapest, based on cost per MP, cost per HP, and everything else. If paying DG is the cheapest item in its calculation, it does that. If MMJ is cheaper, it should do that.

If you don't want it to do whatever is cheapest, don't use it.
If it's incorrect in deciding what's cheapest, then it isn't working properly and that'd be a bug report to be fixed.

As I said, it's there to decide what's best. If it's working as it should, what you've given up is manual control over things that aren't listed in its control page... It does have Doc Galaktik's AO, CN, and FIT in its disable list in the relay browser. Did you try disabling these before making a personal attack on my intelligence?
 
UR is supposed to calculate what's cheapest, based on cost per MP, cost per HP, and everything else. If paying DG is the cheapest item in its calculation, it does that. If MMJ is cheaper, it should do that.
In this particular case, MMJ might be the best restorer, but if the player doesn't have enough meat on hand, UR will fall back to less effective, but purchasable options.
What can also happen is that, if you are only a few MP short of the goal, Doc can become the cheapest option.

UR takes the goal that is set seriously, and won't stop until it is reached.

That said...
Did you try disabling these before making a personal attack on my intelligence?
maybe we should stop feeding the troll.
 
You know, I added that fool to my ignore list, so that I wouldn't have to see him insulting me and others who are trying to help him. I did not expect to have to see his insults quoted by others.

One more insult and you're banned, bucko. Grow up and play nice.
 
What is the interaction between restore_hp() and UR? If I am set up to use UR and call restore_hp() from a script does UR get bypassed?

In my automate at all costs script I just found an infinite loop (of my own creation) because restore_hp() wants to use a tiny house and cannot afford it. I try and do the restore_hp() because baleUr_HPTrouble is false. I'm trying to decide whether there is a logic error on my part or a case where UR is not setting HPTrouble correctly.

Thanks.
 
boolean restore_hp( int ) will pass on the int to your recoveryScript if you have one. However, before calling your recoveryScript, it will call MoodManager.removeMalignantEffects() if the "removeMalignantEffects" property is true.

If you do have "removeMalignantEffects" set to true, and if you have turns of Beaten Up, maybe it is MoodManager.removeMalignantEffects() that is trying to use a tiny house?

Looking at the code in MoodManager.getDefaultAction (which will return to removeMalignantEffects() the CLI command to execute), in the case of Beaten Up, tinyHouseClearable will be true and "use 1 tiny house" will be returned (and executed) if these conditions are met:
Code:
if ( tinyHouseClearable && ( KoLCharacter.canInteract() || InventoryManager.hasItem( UneffectRequest.TINY_HOUSE ) ) )
{
	return "use 1 tiny house";
}

I tested this with my multi (my main has Tongue of the Walrus): I had 0 hp and 0 meat on hand, hp_autoheal was set to 10%, and I had turns of "Beaten Up".
Code:
> get autoSatisfyWithMall

true

> get removeMalignantEffects

true

> ash restore_hp(0);

Searching for "tiny house"...
Desired purchase quantity not reached (wanted 1, got 0)
Using cached search results for tiny house...
Desired purchase quantity not reached (wanted 1, got 0)
You need 1 more tiny house to continue.
Autorecovery failed.
Returned: false

> set autoSatisfyWithMall = false

autoSatisfyWithMall => false

> ash restore_hp(0);

You need 1 more tiny house to continue.
Autorecovery failed.
Whether autoSatisfyWithMall is set to true or false, Mafia stopped after "use 1 tiny house" failed, and UR was never called (so baleUr_HPTrouble wasn't set to true).
Code:
> set removeMalignantEffects = false

removeMalignantEffects => false

> ash restore_hp(50);

Purchasing some palm-frond fans for use as a combat restorative.
Searching for "palm-frond fan"...
Desired purchase quantity not reached (wanted 3, got 0)
You've had the crap beaten out of you... attempting to find some more crap.
Searching for "soft green echo eyedrop antidote"...
Running out of meat! Time to take some out of the closet...

> get baleUr_HPTrouble

false
Requests complete.
Even with "removeMalignantEffects" set to false, in aftercore with 0 meat on hand, I ran into the abort() in use_mall(), so baleUr_HPTrouble wasn't set to true. This shouldn't happen in-run though.

That was kind of long-winded, but I think that the simplest solution would be to set "removeMalignantEffects" to false in-run.
 
Last edited:
Well, there's another global preference that I want on a per character basis.

removeMalignantEffects is true. It sounds like my script logic needs to be reconsidered. Thanks.

Bale, you may move on. Nothing here to see concerning UR ;-)
 
This happened every few adventures tonight, with mafia set to "do not recover hp". Any idea why this script is still triggering?

Restoring HP! Currently at 108 of 225 HP, 169 of 169 MP, current meat: 20510 ... Target HP = 225.
_meatperhp => 2.905983
Casting Cannelloni Cocoon 1 times...
You gain 117 hit points
Cannelloni Cocoon was successfully cast.
You acquire BRICKO brick (3)

and other times it went though all this:

Restoring HP! Currently at 80 of 226 HP, 61 of 181 MP, current meat: 20619 ... Target HP = 226.
Using 2 phonics down...
You acquire an effect: Tingly Biceps (duration: 4 Adventures)
You acquire an effect: Tingly Elbows (duration: 3 Adventures)
You gain 93 hit points
You gain 94 Muscularity Points
Finished using 2 phonics down.
Using 1 tiny house...
You gain 24 hit points
You gain 21 Muscularity Points
Finished using 1 tiny house.
Using 1 cast...
You gain 18 hit points
Finished using 1 cast.
Searching for "doc galaktik's ailment ointment"...
Purchasing Doc Galaktik's Ailment Ointment (1 @ 60)...
You acquire an item: Doc Galaktik's Ailment Ointment
You spent 60 Meat
Purchases complete.
Using 1 Doc Galaktik's Ailment Ointment...
You gain 10 hit points
Finished using 1 Doc Galaktik's Ailment Ointment.
Searching for "doc galaktik's ailment ointment"...
Purchasing Doc Galaktik's Ailment Ointment (1 @ 60)...
You acquire an item: Doc Galaktik's Ailment Ointment
You spent 60 Meat
Purchases complete.
Using 1 Doc Galaktik's Ailment Ointment...
You gain 8 hit points
Finished using 1 Doc Galaktik's Ailment Ointment.
 
Not enough information for me to guess. All I know is that mafia called for recovery since UR does not call itself. I don't know why. More information could help someone figure out why.

Copy-paste the CLI or session log including a section BEFORE recovery was called. (There will likely be some clues there.) Turning up verbosity in the relay script could yield a clue. Finally, copy-paste the following into the CLI and copy-paste the results back here.

get hpAutoRecovery
get hpAutoRecoveryTarget
 
I just tried running around while maojorly poisoned (in order to test a thing where I needed much lower stats, extreme edge case I know) and had set both mafias in-combat sttings to not remove it and removeMalignant status effects to false yet I kept losing the effect. The only way I could stop it from removing it was to set my recoveryScript to "" and settign it back again when finished.

Is this intended behaviour? I feel that if I set mafia to not remove malignant effects then it shouldn't do so and it would be nice if UR also did not try to do so, or am I completely wrong and this is the way it should be?
 
Yep. It's intended behavior.

I actually prefer to set mafia to not remove malignant effects and let the recovery script handle removing poison. Unfortunately for people who want to be poisoned that means they'll need to edit UR or disable it. It's pretty much an extreme edge case so I'm not sorry even though I understand your motive.

I'd recommend commenting out line 1582 if you want to remain poisoned. The culprit looks like this:

Code:
if(!unpoison()) print("Can't cure poison! OOoch! It burns in my veins!", "red");

Turn that into a comment and you'll be fine. You can always remove the commenting if you want to re-enable it.
 
Last edited:
Thank you for the response. I noticed that line when looking through the code seeing if I could find a clue to if this was the way you had thought it out or not. I might add a personal preference to that line in order to minimize the amount of editing. OTOH it is unlikely that I will ever come to the conclusion again that I want to stay poisoned :)
 
I recently installed and set up this script. Ever since I broke the prism, it has been giving me red messages about needing one or more six-packs of new cloaca cola. What's up with that?
 
Back
Top