Universal Recovery Script

Heffed

Member
Looks like it was a mafia problem... I exited Java and restarted KoLmafia and all is well. Not sure what could have caused that unless it was because the previous version had already ran during the same session. Not sure why that would make a difference unless something was hanging out in a buffer?

Anyway, thanks! :)
 

NastyPeasant

New member
OK, I use the universal_recovery script. At one point I did NOT want to use tiny houses or soft green eyedrops, so I unchecked that in the HP/MP usage area.

Yet each time I got beat up, Mafia would still use them.

Now, I'm not sure it's universal_recovery doing this. All I know is that it IS happening, and I had to put those items into my closet to stop it from happening. I'm blaming Universal_Recovery because it has "recovery" in its name...

Anyone know where the cause might lie?

my custom combat options are:
default:
(1) consult FirstThingsFirst.ash
(2) attack with weapon

I'm in kittycore, using the version before 3.411 when it happened (I've upgraded since), but haven't tested it because I still need those tiny houses.
 

Bale

Minion
It might be Universal Recovery doing it, but mafia will still do that all on its own unless you turn off an option in preferences. Mafia has a "remove all negative status effects" preference which I find over-acts to minor status effects.

Aside from mafia's preference for doing that automatically, my script will also remove beaten up, UNLESS you are in the hidden temple or mining for ore. In those locations my script assumes that being beaten up is fine.
 

NastyPeasant

New member
It might be Universal Recovery doing it, but mafia will still do that all on its own unless you turn off an option in preferences. Mafia has a "remove all negative status effects" preference which I find over-acts to minor status effects.

Aside from mafia's preference for doing that automatically, my script will also remove beaten up, UNLESS you are in the hidden temple or mining for ore. In those locations my script assumes that being beaten up is fine.

Other than putting those items into the closet, is there any way to tell universal_recovery that certain things are NOT to be used automatically? Even an option that would tell it to adhere strictly to the options in the Adventure tab, and not go off and automatically use stuff without permission. I just had it use palm fronds I was saving, for instance (unless that was mafia, hard to tell... which brings me to my second question ... )

Also, could a tag be put in front of actions that universal_recovery is taking, so that we know it's the script doing something and not mafia itself? It would help to determine who to swear at when stuff gets used that had been saved for later.

Thanks. It's a really useful script, but it's starting to cause me enough trouble that I'm reconsidering. A few more options to control its behaviour would be welcome.
 

slyz

Developer
The only items you can flag to prevent the script from using are the ones Bale indicated on the first post. I find that closeting items you want to save is a pretty simple way to keep the script's functionality and whatever you are saving up.

The only other option would be to have the script parse all the restores you checked in Mafia and consider only those for using. It would still be better than the build-in Mafia healing, but in my opinion not worth the hassle to set up.

Also, could a tag be put in front of actions that universal_recovery is taking, so that we know it's the script doing something and not mafia itself? It would help to determine who to swear at when stuff gets used that had been saved for later.

I always get lines like this when the script acts :

Code:
Restoring HP! Currently at 222 of 248 HP, 44 of 91 MP... Target HP = 248.

About Beaten Up, it's true that I sometimes want to do lower level stuff or backfarm to wear it off. Instead of closeting my SGEEAs and tiny houses, I tend to simply disable the script (you can set up macros for that in Mafia). Although, since i recently permed Tongue, maybe I won't be doing that anymore. Of course, this goes for players who adventure manually in the relay browser or closely monitor any auto-adventuring that is going on. If you just want to let a script take care of everything, curing Beaten Up is the way to go.

(Also, I'm mostly a lurker but I use the recovery script a lot and wanted to thank Bale for his efforts and everything I have learned from examining his scripts)
 

Bale

Minion
NastyPeasant: For your second question I've already discovered that most people complain when there are a lot of extra lines in their CLI about my script's decisions, so I've turned off most feedback by default. However, it is still there as a hidden option. If you read the first few lines of my script you'll see some options listed. You'll want to set verbose = TRUE. I suggest not setting super_verbose = TRUE, since it is practically guaranteed to annoy the piss out of you. Verbose mode should let you know when you want to swear at my script.

Getting back to the main problem, I suspect that this script isn't for you. The whole concept behind it is that when you're in ronin/hardcore it will use everything useful, not save stuff. In ronin/hardcore it is trying to maximize ascension, not make money. I have little interest in adding code to let you hold onto any random item instead of letting the script use it. Perhaps you'd only want to use it in aftercore when it is trying to conserve meat.

If you could explain to me that holding on to those items is ascension relevant, then I'll reconsider. Otherwise... otherwise you're best off restoring manually or using your closet.

(Also, I'm mostly a lurker but I use the recovery script a lot and wanted to thank Bale for his efforts and everything I have learned from examining his scripts)
I'm glad that you could learn from my efforts. That's one of the reasons I put so many comments into this script.
 

lostcalpolydude

Developer
Staff member
If you could explain to me that holding on to those items is ascension relevant, then I'll reconsider.

Maybe NP wanted to make equipment out of the fronds. I wouldn't consider the equipment to be relevant, but maybe some people do.
 

Bale

Minion
If fronds weren't purchasable for a low price in the mall that would make sense to me. None of the frond equipment is really useful inside of ronin. Now the mummy wrapping, they actually make something useful so I don't automatically use them as bandages.
 

Veracity

Developer
Staff member
Maybe NP wanted to make equipment out of the fronds. I wouldn't consider the equipment to be relevant, but maybe some people do.
Once or twice, I have happened to get enough palm fronds to make a palm-frond cloak before I was done with the Oasis. Considering that I almost always make a bat-ass leather jacket in the Pyramid, it doesn't last long, but it's not completely useless until then.
 

Bale

Minion
Veracity, would you consider moving the listing for "palm-frond fan" higher on the list of restorative options until it is under its spiritual cousin "really think bandage"? If "palm-frond fan" wasn't lost down in the vast wilderness of that dialogue I'd consider this, especially since all the other restoratives that deserve special consideration are all together at the top.
 

Veracity

Developer
Staff member
The restoratives are sorted by average amount of HP healed. If you look at the source, this is clear:

Code:
...
		new HPRestoreItem( "red pixel potion", 110 ),
		new HPRestoreItem( "really thick bandage", 109 ),
		new HPRestoreItem( "filthy poultice", 100 ),
		new HPRestoreItem( "gauze garter", 100 ),
		new HPRestoreItem( "bottle of Vangoghbitussin", 100 ),
		HPRestoreItemList.GRUB,
		new HPRestoreItem( "cotton candy bale", 61 ),
		new HPRestoreItem( "ancient Magi-Wipes", 55 ),
		new HPRestoreItem( "cotton candy pillow", 51 ),
		new HPRestoreItem( "green pixel potion", 50 ),
		new HPRestoreItem( "phonics down", 48 ),
		new HPRestoreItem( "Disco Power Nap", 40 ),
		new HPRestoreItem( "cotton candy cone", 39 ),
		new HPRestoreItem( "palm-frond fan", 37 ),
		new HPRestoreItem( "honey-dipped locust", 36 ),
		HPRestoreItemList.WALRUS,
...

	private static final HPRestoreItem GRUB = new HPRestoreItem( "plump juicy grub", 95 );
	public static final HPRestoreItem WALRUS = new HPRestoreItem( "Tongue of the Walrus", 35 );

I agree that the really thick bandage and palm-frond fan (and red pixel potion) are different from the others in that you have to actually make them from ingredients, rather than serendipitously find them.
 
Last edited:

Bale

Minion
Ah. I'd wondered about the order, but never actually noticed that before. Thanks.

Is there a possibility of getting thick bandage and palm-frond fan into the special section at the top? Alongside the red pixel potion, right under "visit the nuns"? Amusingly, that means only the palm-frond fan would move. No wonder I've been confused about the ordering.
 

Heffed

Member
The latest version is failing on my DB.

Bad item value: "medicinal herbs" (Universal_recovery.ash, line 603)
Bad item value: "medicinal herbs" (Universal_recovery.ash, line 603)
Autorecovery failed.

I'm still having issues now and then that are likely associated with this. Although I haven't seen this particular error again, I often get my moxie or myst characters stuck in a healing loop when the script attempts to use medicinal herbs which fails because they can't visit The Smacketeria.

I only see this if I have ran a muscle character previously. (Logging a musc character off, then logging a myst/mox character in without exiting Java) It's like there is a persistent setting that isn't reset when a new character is loaded.

I can "fix" the loop by healing manually, then the next time it needs to heal it uses the appropriate restores.

Unfortunately it doesn't happen every time, so I'm not quite sure what to make of it. Could this be something the script is doing, or bug with KoLmafia? I never had this happen with any versions of the script prior to the latest, but I guess it's possible that the release happened to coincide with a code update to mafia that could be causing this.

Any ideas?
 

Bale

Minion
Found the bug and fixed it. Lately I've been making my script smaller and more efficient. While doing that I've previously found 2 other potential bugs that nobody ever noticed. :) I guess it's time to release my current version.

Universal recovery v 3.42 released!


Changelog:
version 3.42 November 11, 2009
  • efficiency improvements
  • several rare bug fixes
 
Last edited:
First off, thanks very much Bale, for providing such a great tool!

I have a question though - is there an easy way to set how close to the target HP value it will accept? I keep getting beaten up in the slime tube because ~95% of my max isn't quite enough to survive. I want it to actually heal the full 100% (I have 100% set as the target, of course).
 
Top