Universal Recovery Script

You don't even have to use them manually, just revert to the normal mafia recovery. I often do that during ascensions, especially on day 1 when I really want full control. I have these aliases :

Code:
alias bale => set recoveryScript = Universal_recovery
alias baleno => set recoveryScript =

@Bale: sorry for the lameness of my alias-naming fu.
 
I wasn't impressed to see this :)

_version_BalesUniversalRecovery => 3.432

Restoring HP! Currently at 314 of 1735 HP, 559 of 982 MP, current meat: 8255169 ... Target HP = 1649.
Get thee to a nunnery!
You gain 1,000 hit points
Using 1 scroll of drastic healing...
Finished using 1 scroll of drastic healing.
 
Just one of several things I'm struggling to get right for version 3.5, although I suspect that one won't be properly fixed yet. It's tough and I haven't been inspired lately.
 
So this is interesting. With crimbo adventuring, Universal Recovery has had much more opportunity to fire off since I've been mostly manually adventuring during my HC run and thereby mostly manually restoring. Anyhow, I use the same script for all my accounts, whether softcore or hard core. Mafia remains set not to buy from mall, but the script has permission to buy from mall despite those settings. My HC account is currently a pastamancer post-prism with Tongue of the Walrus permed, but I haven't purchased Cocoon yet. Don't think that's really relevant for this but mentioning it anyhow. While adventuring, using attack with weapon, Universal Recovery was triggered to restore mana. The CLI showed this:

Code:
_version_BalesUniversalRecovery => 3.432
1102 prices updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap
0 prices updated from http://nixietube.info/mallprices.txt
Pricelist updated.
Restoring MP! Currently at 563 of 611 HP, 202 of 733 MP, current meat: 33629 ... Target MP = 733.
In mallmode, best MP restorative is: ancient Magi-Wipes @ 1573.6909 meat total.
Trying to use 10 ancient Magi-Wipes
Searching for "ancient magi-wipes"...
Stopped purchasing ancient Magi-Wipes @ 290.
Failed to use an item from the mall.
Current HP: 563, MP: 202
In mallmode, best MP restorative is: Knob Goblin superseltzer @ 1966.6666 meat total.
Trying to use 20 Knob Goblin superseltzer
Searching for "knob goblin superseltzer"...
Stopped purchasing Knob Goblin superseltzer @ 270.
Failed to use an item from the mall.
Current HP: 563, MP: 202
In mallmode, best MP restorative is: magical mystery juice @ 2042.3076 meat total.
Trying to use 21 magical mystery juice
Purchasing magical mystery juice (21 @ 100)...
You acquire magical mystery juice (21)
You spent 2,100 Meat
Purchases complete.
Using 21 magical mystery juice...
You gain 546 Mana Points
Finished using 21 magical mystery juice.
Current HP: 563, MP: 733
My meat: 31529. Should be successfully healed...

I'm puzzled over the failed purchases. Does the script still think I'm in HC pre-prism? I broke the prism several days ago.

Edit: My script has these settings at the beginning:
Code:
boolean ignore_buy_pref = true; // If you restrict mafia from purchasing from NPC stores & mall, set this TRUE to ignore that.
boolean never_mall = false; 	// Is it okay to purchase from the mall outside of ronin? If true it always stays in hardcore mode
 
Last edited:
That's not a bug, that's a wonderful feature! When price has gotten higher than anticipated (because someone else bought out the stock or whatnot), the purchase will be halted and my script will recalculate the best restorative based on the new mall price.

I really love that example of my script working admirably. First it decides that magi-wipes are the cheapest way to recover MP, but discovers that the cheapest one in the mall is more expensive than the anticipated price of 290 meat each. So it switches to superseltzers as the cheapest, but unfortunately they're also sold out, at the price of 270 meat each. Finally it gets around to mmj as being cheaper than anything currently available.

The reason that you're seeing a lot of this now and didn't notice it before is that everyone else is doing the same thing that you are. I've had a surprising amount of people send me notifies for this script recently.

My script is awesome!!!
 
Universal recovery v 3.5 released!


Changelog:
version 3.5 December 23, 2009
  • Calculates meat per mp and hp for assistance to other scripts such as zarqon's SmartStasis
  • Refrains from stockpiling antidotes until level 5
  • If mafia set to "do not recover hp", then it won't recover from Beaten Up
  • Refrains from using Nun healing for HP if it would need to use Cannelloni Cocoon or a scroll of drastic healing afterwards
 
Last edited:
Not sure what trickery you've been doing to post your builds but I guess I need to clear my cache again because every time I click the download link I get:

Code:
Invalid Attachment specified. If you followed a valid link, please notify the administrator

Edit: Clearing the cache didn't work, so I did what I would do if it were any other thread. I checked the first post in the thread to see if you updated it there and lo and behold, I think you did and I got it from there rather than your announcement post above this one.
 
Last edited:
My bad. Fixed the link in that post. Thanks for alerting me.

I can't wait to see what zarqon is going to do with my new feature. This is the first time I've added a feature to a script, specifically so it can be used by someone else's scripts.
 
Line 736 gives errors: Division by Zero
Only happens after healing with scroll of drastic healing, so I wrapped that line with another if, but I guess you'll want to take care of it properly.
 
Oh yeah, that was a little dumb of me. The correct fix was simpler than the one you used. (Your fix screws up _meatperhp.)

Since only 6 people have downloaded this script I don't want to bump the version number. Just re-download it please.
 
Are you sure you re-downloaded it? The former line 736 is now on line 735, so it couldn't even be the same division by zero!
 
Last edited:
I am getting the same error as Glaykith. I have tried the script on the front page and a few pages back.

_version_BalesUniversalRecovery => 3.5
Already updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap in this session.
Already updated from http://nixietube.info/mallprices.txt in this session.
Pricelist updated.
_meatpermp => 1.3513514
_meatperhp => 0.38610038
Restoring MP! Currently at 1524 of 2025 HP, 231 of 3128 MP, current meat: 24009900 ... Target MP = 1564.
Using 1 Oscus's neverending soda...
You gain 288 Mojo Points
Finished using 1 Oscus's neverending soda.
Purchasing magical mystery juice (15 @ 100)...
You acquire magical mystery juice (15)
Purchases complete.
Division by zero (Universal_Recovery.ash, line 736)
Autorecovery failed.
 
I think the files are the same. First page = attachment 2318 and that is why both are throwing the same error.

I used NotePad++ to diff them and it said they are identical.
 
Infinite Loops!

Code:
> Restoring MP! Currently at 190 of 245 HP, 11 of 129 MP, current meat: 45 ... Target MP = 12.
 > Cannot restore MP because fizzy invigorating tonic is disabled!
 > Restoring MP! Currently at 190 of 245 HP, 11 of 129 MP, current meat: 45 ... Target MP = 12.
 > Cannot restore MP because fizzy invigorating tonic is disabled!
 > Restoring MP! Currently at 190 of 245 HP, 11 of 129 MP, current meat: 45 ... Target MP = 12.
 > Cannot restore MP because fizzy invigorating tonic is disabled!
 > Restoring MP! Currently at 190 of 245 HP, 11 of 129 MP, current meat: 45 ... Target MP = 12.

and

Code:
> Insufficient meat to fully restore MP without wasting restoratives!
 > Restoring MP! Currently at 184 of 227 HP, 0 of 118 MP, current meat: 3 ... Target MP = 12.
 > Insufficient meat to fully restore MP without wasting restoratives!
 > Restoring MP! Currently at 184 of 227 HP, 0 of 118 MP, current meat: 3 ... Target MP = 12.
 > Insufficient meat to fully restore MP without wasting restoratives!
 > Restoring MP! Currently at 184 of 227 HP, 0 of 118 MP, current meat: 3 ... Target MP = 12.
 > Insufficient meat to fully restore MP without wasting restoratives!
 > Restoring MP! Currently at 184 of 227 HP, 0 of 118 MP, current meat: 3 ... Target MP = 12.
 > Insufficient meat to fully restore MP without wasting restoratives!
 > Restoring MP! Currently at 184 of 227 HP, 0 of 118 MP, current meat: 3 ... Target MP = 12.
 > Insufficient meat to fully restore MP without wasting restoratives!
 > Restoring MP! Currently at 184 of 227 HP, 0 of 118 MP, current meat: 3 ... Target MP = 12.
 > Insufficient meat to fully restore MP without wasting restoratives!
 
i just downloaded this a few minutes ago, and i'm getting this:

Code:
Restoring MP! Currently at 1160 of 1476 HP, 148 of 1718 MP, current meat: 22638098 ... Target MP = 1718.
Get thee to a nunnery!
You gain 316 hit points
You gain 1,000 Mana Points
Purchasing magical mystery juice (8 @ 100)...
You acquire magical mystery juice (8)
Purchases complete.
Division by zero (Universal_recovery.ash, line 736)

any idea why?
 
Last edited:
Universal recovery v 3.51 released!


Changelog:
version 3.51 December 23, 2009
  • Found and fixed another stupid division by zero error. I'm an idiot.




Infinite Loops!
This is extremely puzzling and I don't think it is the fault of the most recent update. Can you send me some more of your session log so that I can try to put those snippets in context? It would help if I could see what was happening immediately before it got into that loop. Most importantly I want to know how the script was called. It could have been called for regular between adventure recovering, or it can be called to heal a specific amount of MP for spellcasting. Those situations are different. I'm guessing that it wasn't called to heal HP (and needed MP to cast a healing spell) since you've already got quite a bit of HP already.

If you think you can edit super_verbose = true and recreate the problem, that would be awesome.
 
Last edited:
Running v3.51 advises to upgrade to v3.51. I modified the string this_ver line appropriately after double checking I was running the right script. Just mentioning it in case anyone else is puzzled by it.
 
Thanks Spiny. I fixed the script's version number, so people can re-download it if they are having trouble with the script not knowing its own version.
 
Back
Top