Universal Recovery Script

Actually verbose really did help a lot for me to narrow down the possibilities for the problem. I'm pretty sure I've got it fixed. You did exactly what I needed and this should solve the bug. Please test this and report back if it works. I'd been meaning to release a new version anyway. :D


Universal recovery v 3.4 released!


Changelog:
version 3.4 October 4, 2009
  • Added a few more location specific controls to aid adventuring
  • Stopped attempted purchase of antidotes if user doesn't want to purchase from NPC stores
  • Adjusted dynamic changes to current mall prices to improve price efficiency
  • Miscellaneous bugs fixed
 
Last edited:
Woo new version. Will check it out tonight.

In hardcore it will give preference to using items to restore whenever it can. You'll probably see them used eventually. Probably sometime when you need mp and you're also down 20 hp you'll note it being used. Or maybe some time when both HP and MP are quire low you'll see the shard consumed so that you can cast tongue of the walrus.

I have noticed it doing this on occassion which was cool. Like I said I was just confused as to why it wasn't using it.

Just need to learn to trust the script.

Often I see items consumed at times that make me very happy. Other times I decide that it is a good time to assume manual control. My algorithms and procedures in this script aren't perfect, but they do work more often than not.

For the most part I'm very happy with this script. I'm finding I get beaten up a lot less often between this script and being smarter about my healing thresholds.

If you can clearly describe the logic that you use for healing, I'd probably incorporate it into my script if I can figure out how to reconcile it with the existing framework. I'm always trying to make this better.

I have no special logic in regards to healing :)
 
Uh oh! Problem! I didn't realize I was short on funds and didn't expect it to be a problem as things have been going smoothly for quite some time now. So what changed? I double checked that I changed my settings as I usually do.

Code:
_BalesUniversalRecovery => 3.4
1059 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 966 of 966 HP, 1034 of 1527 MP... Target MP = 1527, current meat: 170.
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Failed to use an item from the mall.
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
KoLmafia declares world peace.

For kicks, I reverted back to my prior version:

Code:
> set recoveryScript=Universal_recovery_new_Spiny.ash

recoveryScript => Universal_recovery_new_Spiny.ash
Validating adventure sequence...
Requests complete.

_BalesUniversalRecovery => 3.334
New version available: 3.4
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.
Restoring MP! Currently at 966 of 966 HP, 1034 of 1527 MP... Target MP = 1527, current meat: 170.
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Desired purchase quantity not reached (wanted 10, got 0)
Purchasing magical mystery juice (1 @ 100)...
You acquire an item: magical mystery juice
Purchases complete.
You need 9 more magical mystery juice to continue.
Failed use an item from the mall
Current HP: 966, MP: 1034
In mallmode, best MP restorative is: magical mystery juice @ 957.2816 meat total.
Trying to use 10 magical mystery juice
Running out of meat! Time to take some out of the closet...

Requests complete.

The difference, from what I can tell, is that the new version isn't buying that single MMJ to get to the point of triggering the Running out of meat message so it just keeps looping without getting satisfied in this situation.
 
Last edited:
Huh! This is a pretty tricky one actually. It's caused by an interesting interaction of three different functions Thanks for finding it.

Unfortunately I'm stumped on solving the problem right now. I'll try later, when I can focus properly.
 
The above problem is still frustrating me. Had 800 meat on hand and needed 9 mmjs. It just kept looping thru:

Code:
In mallmode, best MP restorative is: magical mystery juice @ 819.4175 meat total.
Trying to use 9 magical mystery juice
Desired purchase quantity not reached (wanted 9, got 0)
Failed to use an item from the mall.
Current HP: 955, MP: 1202

Mafia almost became totally unresponsive and Escape wasn't helping. I bought 8 mmjs and tried to continue on. The script then said:

Code:
Restoring MP! Currently at 955 of 1018 HP, 1202 of 1624 MP... Target MP = 1624, current meat: 3.
In mallmode, best MP restorative is: magical mystery juice @ 819.4175 meat total.
Trying to use 9 magical mystery juice
Running out of meat! Time to take some out of the closet...

So I manually used the 8 mmjs and then could continue adventuring.
 
I found the problem, Spiny. The three parameter version of the buy() function doesn't work the way I expected. I could rewrite the script to fix the problem, but I'm pretty sure that the problem is with buy() not working as intended, so I'm filing a bug report instead.
 
Restoring HP! Currently at 148 of 1166 HP, 331 of 1176 MP... Target HP = 1166.

Get thee to a nunnery!
You gain 1,000 hit points
Get thee to a nunnery!
You gain 18 hit points

The second visit was kinda wasted methinks.
 
What the heck?! That doesn't seem possible! I'm looking at the code right now and it's too clean to have such a problem... I'll continue considering the problem, but could you check if there was some problem on your side?

Also, give me more information: What version of my script are you running? (That information is on line 1.) Are you in aftercore? What class are you?

I can tell from the output that you completed the quest as a hippy, but is there anything else you can think of that might be relevant?
 
Get thee to a nunnery!
You gain 1,000 hit points
Get thee to a nunnery!
You gain 18 hit points

The second visit was kinda wasted methinks.

I have been seeing similar using dj_d's dailygrind at 541 and then 1 when visiting the nuns. I think it might not be your script!
 
dailygrind.ash is part of the Ascend.zip package. It ends with:

Code:
#use up nuns
cli_execute("cast * leash");
boolean foo = cli_execute("nuns");
foo = cli_execute("nuns");
foo = cli_execute("nuns");
 
// Bale's all purpose Universal recovery script v 3.4

I am in aftercore.

I'm an AT.

I was using your script in conjunction with Alhifar slime script.

From the session log, with a few more lines:

You gain 71 Muscleboundness
You gain 74 Wizardliness
You gain 215 Smarm
> Restoring HP! Currently at 148 of 1166 HP, 331 of 1176 MP... Target HP = 1166.

postwarisland.php?place=nunnery&action=nuns&pwd
You gain 1,000 hit points
postwarisland.php?place=nunnery&action=nuns&pwd
You gain 18 hit points
> The slime covering you will kill you if you don't do something! Hitting up your clan.
clan_slimetube.php?action=chamois&pwd
You lose an effect: Coated in Slime


Any other information I can supply?
 
Last edited:
I got this today almost immediately after starting in the slimetube, though today it might have been justified:

Restoring HP! Currently at 821 of 2496 HP, 878 of 3901 MP... Target HP = 2496, current meat: 314248.
Get thee to a nunnery!
You gain 1,000 hit points
Get thee to a nunnery!
You gain 675 hit points

I've set the script to verbose mode, but I don't see any more data.
 
I found the bug. I'm happy, but frustrated that I couldn't see that flaw the first time. Thanks for your perseverance. It shouldn't waste nun restorations like that now.

I don't feel like doing a full release, so here's the most recent version for you or anyone else who wants to download it:

Edit: attached copy deleted since I made a new release.
 
Last edited:
Is there anyway to turn off the auto recover beaten up status. I don't always want it to use one of my clan VIP charge when that happens.
 
There is a way to turn off usage of the VIP Hot Tub. Near the top of the script you'll see this

Code:
// OPTIONS:
boolean mall = true;           // Purchase from the mall outside of ronin? If false it stays in hardcore mode
boolean use_hot_tub = true;    // If this is set to false, this script will not use the hot tub.
Change use_hot_tub to false. I put that in for the sake of those who might want to save the hot tub for removing slime. I assume that's your issue.
 
Because of a change to mafia in r7751, I'm releasing the new version today. The new KolMafia build is required. Download it here!


Universal recovery v 3.41 released!


Changelog:
version 3.41 October 19, 2009
  • removed special location handling because it is unreleased to recovery
  • fixed for compatibility with daily build r7751+
  • bug with nun recovery fixed
  • tiny program improvements that make me happy
 
Last edited:
Back
Top