Universal Recovery Script

I am getting nearly constant "Did not fully restore HP for some reason." "Did not fully restore MP for some reason." errors using this script in HC NA. I'd love to give you more info, but that's all the info it gives me. It doesn't tell me what it's trying to use so I can determine what the problem is.
It can't tell you what it is trying to use, because those messages mean there is nothing to use. Without NPC stores, recovery in NA is difficult. Is there something you expect it to use that it isn't using?
 
I am getting nearly constant "Did not fully restore HP for some reason." "Did not fully restore MP for some reason." errors using this script in HC NA. I'd love to give you more info, but that's all the info it gives me. It doesn't tell me what it's trying to use so I can determine what the problem is.

I suspect the issue is that you are in a NA ascension where you have no healing skills and cannot purchase healing items so it uses up the healing items you have present and then cannot fully restore HP for the reason that there's no options left. (Aside from Hot Tub and free resting that it will leave to you except in very specific circumstances.)

If there is a healing option other than Hot Tub and resting that it is failing to use, then please find it and let me know. You might get slightly more information if you turned up the verbosity level with the relay script. (Drop down in lower-right of top menu.)
 
There's always the option to use the regeneration chamber at the shelter. Yes, it takes a turn, but if that's the only recovery available why is it not using it?

Rest at the campground *IS* checked.
 
There's always the option to use the regeneration chamber at the shelter. Yes, it takes a turn, but if that's the only recovery available why is it not using it?

Rest at the campground *IS* checked.

Because no one has asked for that and Bale likely didn't ask himself for it. I've never used that thing and don't even consider it to exist. It requires additional programming to support. While I do know people willing to spend a turn healing automatically they are very rare, so the "why" is right there. No one before you has cared enough to notice. That said, Bale is very sweet about adding stuff he'd never use once someone asks.
 
Ummm? Actually, UR is supposed to support that. Kailen4 is correct. (There's a setting for it in the relay configuration.) Someone asked for it a long time ago and since I'm sweet about adding stuff that other people ask for I tried to add it. However I never use that feature so I never really know if it is working unless I get feedback.

The way it is implemented it won't rest unless you can do something with the mp as well as the hp. Because spending adventures on resting is so harsh. Nobody has ever complained about that method before, but in NA sometimes resting is the ONLY way to get back HP. I figure that the need to get back HP when MP is full is the reason why it is failing for Kailen4. So it is working differently because of the harsh demands of this path.

Thanks for pointing out that UR wasn't getting things done. I'm in NA, but I just don't enable campground resting when it takes a turn so I did not realize.

Anyway, give me a little time to figure out how it should be working and maybe refactor that code since it is tied in a knot that will have to be unraveled.
 
Thank you.

I dunno if it's just the sour mood I've been in lately or what, but if my last post came off as curt I didn't mean it. I was merely reporting that it wasn't working as intended, or as I believed to be intended (which appears to have been the case.) I appreacate all the work everyone puts into this app and scripts. So thank you, Bale, and everyone else.
 
I decided that a simple solution would work best and made a commit to make UR more forgiving about spending adventures resting (if it is enabled) when you are experiencing a Nuclear Autumn.

Update now and let me know if it works the way you expect: svn update mafiarecovery
 
Last edited:
I decided that a simple solution would work best and made a commit to make UR more forgiving about spending adventures resting (if it is enabled) when you are experiencing a Nuclear Autumn.

Update now and let me know if it works the way you expect: svn update mafiarecovery
Fixed the command for you. :)
 
It appears the script miscalculates the number of "Internal Soda Machine" casts needed to reach the goal.

Line 988 says:

Code:
int q = min(ceil((target - my_mp()) / 10), my_meat() / 20);

The ceil function is supposed to round up (to the next integer) if the number of MP to restore is not evenly divisible by 10.

However, because both sides of the division are integers, ash performs an integer division and ceil() doesn't do anything. This results in Universal Recovery outputting "Did not fully restore MP for some reason." because at line 991, my_mp() is less than the target.

When I replace the integer 10 by a float 10.0, it appears to work as expected.
 
Integer division automatically truncates. Sorry about that; because of my proton pack I'm swimming in MP, even in hardcore, and don't get much use out of that skill.

Committed the fix.
 
Well, I'm not getting the message anymore. Though it appears to be going to the chateau (also an option) instead of the shelter's chamber. Which is fine. Guess that wasn't working right before either or something, and got fixed along the way? (This post is probably not helpful...)
 
I'm glad it is working for you now.

As for the Chateau, it has always been UR and mafia's preference to use the Chateau instead of the Campground for resting because the HP and MP restoration (and stats) are always better and the two have the same cost of an adventure or free rest.

Chateau isn't flashy, but it is probably one of my most powerful IotM.
 
Might I suggest change line 1207 from:
Code:
			if(item_amount(key) >0 && value.avehp > my_maxhp() - my_hp() && value.maxhp > 120 && my_maxhp() > 100 && my_hp() < my_maxhp() / 5)
to:
Code:
			if(item_amount(key) >0 && value.avehp > my_maxhp() - my_hp() && value.maxhp > 120 && my_maxhp() > 100 && my_hp() < my_maxhp() / 5 && key != $item[medicinal herb's medicinal herbs])

UR just LOVES to try to use herbs after rejecting chewing them. And then mafia rejects the failed attempt and gives me a sad warning.
If we aren't going to chew the herbs in line 1194, we shouldn't try to use them improperly in 1208. Thanks.
 
Thanks. That's one of the spots, but I think there was another one I'd found that needed to be blocked out before, since it's still throwing warnings/fails. But a spleen check on any use() best-of-any-possible-item selector would be lovely. :)
 
Thanks! Having random bonus herbs doesn't really affect much, but it's still sad seeing warnings that don't need to be there. :) Yay!
 
Is there a way to prefer using Psychokinetic energy blobs? There's apparently a trophy if you use 999 of them. I don't see a way to prioritize their use in the preferences.
 
Last edited:
I would suggest making type "MP" not be case sensitive, as I just had to check the source to see why it was restoring my HP instead.
 
Back
Top