Universal Recovery Script

That's actually a worthwhile point. Perhaps I should add a preference to disable use of the DoD potion?
 
I've never considered healing an opponent. If I want an opponent to last longer, I raise the ML. It's an interesting thought though, but generally there aren't enough DoD pots in my inventory in-run to consider such a use.
 
Like I said, it's the only thing I've ever used it for. Everything else does fine with extra ML, but if I don't have a stainless scarf, there's not usually enough +ML to make sure the adding machine doesn't die from creating both scrolls at once. Again, this is rare; it requires having a potion of healing identified AND the stuff for both the gates & leet scrolls, so maybe 1 in 5 runs at the most. But still, in general, if it isn't controlled by a mafia preference, and extra preference for an item specific to the script would be nice (in general; you never know).

Haven't had the stars align for this yet, but another potential use comes to mind: again, vs. an adding machine, using a healing potion if one is careless enough to bring a starfish-type (or other attacking familiar) into battle, and it gets a shot in before you make the gates scroll. The one time I've been careless enough to do that, I had nothing in my inventory to help, and the adding machine died before I got my scroll. :(
 
If what I think is happening is not what is happening, please forgive and correct my misunderstanding.

So I started running UR several weeks ago and it went out and bought a bunch of stuff to use as combat restore. Fine. A few days later it buys something else but I don't really pay attention. Then it stops buying things. Then the cached price bug gets fixed. Now it seems to find something it wants to buy every day. My guess is that it uses price information to compute the optimal in combat restore and then buys that item if necessary. This is wonderful except that for this particular character I never needs in-combat restoration. (Well, not actually "never" but farming with a Level 62 character reduces the chance considerably). So, if my hypothesis is correct, would it be reasonable to ask that UR not purchase in-combat restores if there are already adequate supplies in inventory even if using those would be sub-optimal from a "meat per point" view?

Thanks.
 
If you never use the MP restores in combat, UR won't buy any more. I think the maximum number of MP restoring items UR will keep for use in-combat is 3.
 
If you never use the MP restores in combat, UR won't buy any more. I think the maximum number of MP restoring items UR will keep for use in-combat is 3.

According to my session logs for the past month, UR has purchased palm-frond fans, green pixel potions, Knob Goblin superseltzers and bottles of Monsieur Bubble as combat restoratives. I consumed none of those things in combat. One or two of the buys occurred because I sold the item, but not all of them. If your memory of 3 and my hypothesis are correct then this is a feature request that UR never even consider purchasing combat restoratives unless there are less than 3 in inventory.
 
Well, frob, you've definitely got a point. I never really considered the matter because the meat cost of keeping a couple of such items on hand seems so low, but it might be better if the script simply acknowledged that you're set for in-combat restoration and didn't purchase anything.

I'm not adding this feature right now since it's fairly minor, but I'll keep it in mind for the next time I dig into UR.

If you never use the MP restores in combat, UR won't buy any more. I think the maximum number of MP restoring items UR will keep for use in-combat is 3.
Actually, the number is based on how much the items heal. You need fewer for more powerful items.
 
Actually, the number is based on how much the items heal. You need fewer for more powerful items.
I misread the code, the number 3 is only in HC/Ronin (when you have more than 6k meat).

So, any day where there is a cheaper combat restorative available in the mall, it will buy some more?
If anything, you actually made a profit if you put the old ones back in the mall =)
 
Now, I might have brought this on myself (did a manual click on restore hp while mafia was doing an automatic one) but I still found it to be rather odd:

Code:
[7111] Fernswarthy's Basement (Level 252)
Encounter: The Beast with 4,604 Ears
Round 0: winterbay loses initiative!
You lose 253 hit points
Monster value: -0.1
Round 1: winterbay casts ENTANGLING NOODLES!
Monster value: -0.1
Round 2: winterbay casts FEARFUL FETTUCINI!
Monster value: -0.1
Round 3: winterbay casts FEARFUL FETTUCINI!
You gain 316 Muscleboundness
You gain a Muscle point!
You gain 594 Wizardliness
You gain a Mysticality point!
You gain 318 Chutzpah
Restoring HP! Currently at 846 of 3940 HP, 8522 of 8811 MP, current meat: 27227871 ... Target HP = 3940.
_meatperhp => 0.012075837
Putting on stainless steel solitaire...

> restore hp

Equipment changed.
Putting on woven baling wire bracelets...
Restoring HP! Currently at 846 of 3940 HP, 8522 of 9045 MP, current meat: 27227871 ... Target HP = 3940.
_meatperhp => 0.01278618
Casting Cannelloni Cocoon 1 times...
Equipment changed.
You gain 3,094 hit points
Cannelloni Cocoon was successfully cast.
Putting on C.A.R.N.I.V.O.R.E. button...
You need 1 more Xlyinia's notebook to continue.
Did not fully restore HP for some reason.

Why do I need Xlyinia's notebook?
 
I use Xylinia's notebook as a null item that restores nothing because I know that nobody will have it and it will pass as an item to avoid errors. It was trying to re-equip it for some reason. The script might have glitched because of what you did; I'm not sure. At least you know why I referenced such an item.
 
ACK!

On my aftercore Seal Clubber, I'm thrashing Mother Hellseals for xp. This entails LTS for 1 or 2 rounds. Recovery is set to fire at 50% to full for both hp and mp. UR tends to use Tongue of Walrus for hp restoration and then next call it will buy ancient magi-wipes to restore mana and newly lost hp. Worked fine yesterday while automating. Worked fine most of tonight's turns which I've been doing in bursts as I explore different gear/potion setups.

Here it's all good:

Code:
Restoring HP! Currently at 643 of 1103 HP, 370 of 642 MP, current meat: 179645 ... Target HP = 1103.
In mallmode, best HP restorative is: scroll of drastic healing @ 495.33334 meat total.
In mallmode, best MP restorative is: ancient Magi-Wipes @ 436.36365 meat total.
Mall price to restore 140MP is 382 meat.
Cast a healing skill.
Casting Tongue of the Walrus 13 times...
You gain 442 hit points
Tongue of the Walrus was successfully cast.
Current HP: 1085, MP: 240
In mallmode, best HP restorative is: gauze garter @ 33.300003 meat total.
In mallmode, best MP restorative is: ancient Magi-Wipes @ 436.36365 meat total.
Mall price to restore 10MP is 28 meat.
Cast a healing skill.
Casting Tongue of the Walrus 1 times...
You gain 39 hit points
Tongue of the Walrus was successfully cast.
Current HP: 1103, MP: 230
My meat: 179645. Should be successfully healed...
Restoring MP! Currently at 1103 of 1103 HP, 230 of 642 MP, current meat: 179645 ... Target MP = 642.
In mallmode, best MP restorative is: ancient Magi-Wipes @ 1123.6364 meat total.
Trying to use 8 ancient Magi-Wipes
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (8 @ 150)...
You acquire ancient Magi-Wipes (8)
Purchases complete.
Using 8 ancient Magi-Wipes...
You gain 423 hit points
You gain 444 Muscularity Points
Finished using 8 ancient Magi-Wipes.
Current HP: 1103, MP: 642
My meat: 178445. Should be successfully healed...

Request 6 of 42 (Volcano: The Broodling Grounds) in progress...

[2846] The Broodling Grounds
Encounter: mother hellseal
Strategy: /home/.kolmafia/ccs/tangodefault.ccs [mother hellseal]
Round 0: Tango Clubdancer loses initiative!
You lose 169 hit points
Round 1: Tango Clubdancer executes a macro!
Round 1: Tango Clubdancer casts LUNGING THRUST-SMACK!
Round 2: mother hellseal takes 156 damage.
Round 2: Got starts a hippy drum circle, and your opponent joins in instead of attacking this round.
Round 2: Tango Clubdancer casts LUNGING THRUST-SMACK!
Round 3: mother hellseal takes 131 damage.
After Battle: Got surveys the scene from atop the throne, and gains 1 Experience.
You acquire an item: hellseal hide
You acquire an item: hellseal claw
After Battle: XpSenior bends its brim into an approximation of a smile.
You gain 266 Strengthliness
You gain 139 Mysteriousness
You gain 137 Sarcasm

Request 7 of 42 (Volcano: The Broodling Grounds) in progress...

[2847] The Broodling Grounds
Encounter: mother hellseal
Strategy: /home/.kolmafia/ccs/tangodefault.ccs [mother hellseal]
Round 0: Tango Clubdancer loses initiative!
You lose 169 hit points
Round 1: Tango Clubdancer executes a macro!
Round 1: Tango Clubdancer casts LUNGING THRUST-SMACK!
Round 2: mother hellseal takes 160 damage.
You lose 170 hit points
Round 2: Tango Clubdancer casts LUNGING THRUST-SMACK!
Round 3: mother hellseal takes 196 damage.
After Battle: Got surveys the scene from atop the throne, and gains 1 Experience.
You acquire an item: hellseal sinew
You acquire an item: hellseal claw
After Battle: XpSenior bends its brim into an approximation of a smile.
You gain 261 Strongness
You gain a Muscle point!
You gain 131 Mysteriousness
You gain 151 Roguishness
You gain a Moxie point!

Restoring HP! Currently at 643 of 1105 HP, 610 of 642 MP, current meat: 178445 ... Target HP = 1105.
In mallmode, best HP restorative is: scroll of drastic healing @ 495.33334 meat total.
In mallmode, best MP restorative is: ancient Magi-Wipes @ 436.36365 meat total.
Mall price to restore 140MP is 382 meat.
Cast a healing skill.
Casting Tongue of the Walrus 13 times...
You gain 478 hit points
Tongue of the Walrus was successfully cast.
Current HP: 1105, MP: 480
My meat: 178445. Should be successfully healed...

Request 8 of 42 (Volcano: The Broodling Grounds) in progress...

[2848] The Broodling Grounds
Encounter: mother hellseal
Strategy: /home/.kolmafia/ccs/tangodefault.ccs [mother hellseal]
Round 0: Tango Clubdancer loses initiative!
You lose 169 hit points
Round 1: Tango Clubdancer executes a macro!
Round 1: Tango Clubdancer casts LUNGING THRUST-SMACK!
Round 2: mother hellseal takes 318 damage.
After Battle: Got surveys the scene from atop the throne, and gains 1 Experience.
You acquire an item: hellseal sinew
You acquire an item: hellseal whisker
After Battle: XpSenior bends its brim into an approximation of a smile.
You gain 298 Strongness
You gain 128 Wizardliness
You gain 118 Smarm

Request 9 of 42 (Volcano: The Broodling Grounds) in progress...

[2849] The Broodling Grounds
Encounter: mother hellseal
Strategy: /home/.kolmafia/ccs/tangodefault.ccs [mother hellseal]
Round 0: Tango Clubdancer loses initiative!
Round 1: Tango Clubdancer executes a macro!
Round 1: Tango Clubdancer casts LUNGING THRUST-SMACK!
Round 2: mother hellseal takes 253 damage.
After Battle: Got surveys the scene from atop the throne, and gains 1 Experience.
You acquire an item: hellseal brain
After Battle: XpSenior bends its brim into an approximation of a smile.
You gain 268 Fortitude
You gain 141 Enchantedness
You gain a Mysticality point!
You gain 133 Chutzpah

Request 10 of 42 (Volcano: The Broodling Grounds) in progress...

[2850] The Broodling Grounds
Encounter: mother hellseal
Strategy: /home/.kolmafia/ccs/tangodefault.ccs [mother hellseal]
Round 0: Tango Clubdancer loses initiative!
You lose 169 hit points
Round 1: Tango Clubdancer executes a macro!
Round 1: Tango Clubdancer casts LUNGING THRUST-SMACK!
Round 2: mother hellseal takes 181 damage.
You lose 169 hit points
Round 2: Tango Clubdancer casts LUNGING THRUST-SMACK!
Round 3: mother hellseal takes 196 damage.
After Battle: Got surveys the scene from atop the throne, and gains 1 Experience.
You acquire an item: hellseal brain
After Battle: XpSenior bends its brim into an approximation of a smile.
You gain 287 Strongness
You gain a Muscle point!
You gain 118 Enchantedness
You gain 138 Chutzpah

At this point a new call the script occurs and havoc breaks loose in an infinite loop I had to manually abort. I believe the problem may be that the store selling the magi-wipes at 150 has a limit of 150 per day which I most likely reached:

Code:
[color=green]Restoring HP! Currently at 661 of 1108 HP, 448 of 643 MP, current meat: 178445 ... Target HP = 1108.[/color]
[color=blue]In mallmode, best HP restorative is: scroll of drastic healing @ 495.33334 meat total.[/color]
[color=blue]In mallmode, best MP restorative is: ancient Magi-Wipes @ 436.36365 meat total.[/color]
[color=blue]Mall price to restore 130MP is 355 meat.[/color]
[color=blue]Cast a healing skill.[/color]
Casting Tongue of the Walrus 12 times...
You gain 419 hit points
Tongue of the Walrus was successfully cast.
[color=blue]Current HP: 1080, MP: 328[/color]
[color=blue]In mallmode, best HP restorative is: gauze garter @ 51.8 meat total.[/color]
[color=biue]In mallmode, best MP restorative is: ancient Magi-Wipes @ 436.36365 meat total.[/color]
[color=blue]Mall price to restore 10MP is 28 meat.[/color]
[color=blue]Cast a healing skill.[/color]
Casting Tongue of the Walrus 1 times...
You gain 31 hit points
Tongue of the Walrus was successfully cast.
[color=blue]Current HP: 1108, MP: 318[/color]
My meat: 178445. Should be successfully healed...
[color=cyan]Restoring MP! Currently at 1108 of 1108 HP, 318 of 643 MP, current meat: 178445 ... Target MP = 643.[/color]
[color=blue]In mallmode, best MP restorative is: ancient Magi-Wipes @ 886.36365 meat total.[/color]
[color=green]Trying to use 6 ancient Magi-Wipes[/color]
Searching for "ancient magi-wipes"...
Purchasing ancient Magi-Wipes (6 @ 150)...
[color=red]Stopped purchasing ancient Magi-Wipes @ 199.[/color]
[color=red]Failed to use an item from the mall.[/color]
[color=blue]Current HP: 1108, MP: 318[/color]
[color=blue]In mallmode, best MP restorative is: ancient Magi-Wipes @ 886.36365 meat total.[/color]
[color=green]Trying to use 6 ancient Magi-Wipes[/color]
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (6 @ 150)...
[color=red]Stopped purchasing ancient Magi-Wipes @ 199.[/color]
[color=red]Failed to use an item from the mall.[/color]
[color=blue]Current HP: 1108, MP: 318[/color]
[color=blue]In mallmode, best MP restorative is: ancient Magi-Wipes @ 886.36365 meat total.[/color]
[color=green]Trying to use 6 ancient Magi-Wipes[/color]
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (6 @ 150)...
[color=red]Stopped purchasing ancient Magi-Wipes @ 199.[/color]
[color=red]Failed to use an item from the mall.[/color]
[color=red]KoLmafia declares world peace.[/color]

I tried buying 1 at 199 and then "restore mana" to see if it would realize the new price, but it still wants magi-wipes at 150.
 
Last edited:
Weird. I thought that it would adjust price if it ran out of a store limit. Anyway, it seems I need to have some code to lock out an item if it repeatedly fails to purchase it for a reasonable price. I thought I had something like that, but apparently it failed.

I'll get to this later. Probably in a day or two. It might be good to take a break from all the relay script stuff I've been working on lately.
 
Yeah I thought you had something like that too... was trying to find it in the backpages of this thread when it came up before, but it didn't jump out at me at a quick search. Anyhow, thank you for looking into it. I'll see what I can do in the meantime to get thru tonight's turns and keep the mana flowing :)

Edit: Never did get around to finishing those turns last night, so finishing them off now. It seems today the lowest mall price for magi-wipes is 190 with no limit, so I did "restore mana" and the script was successfully able to get past where it got stuck last night due to the store limit I'd exceeded for the day.

Code:
> restore mana

[color=cyan]Restoring MP! Currently at 1108 of 1108 HP, 374 of 643 MP, current meat: 184336 ... Target MP = 643.[/color]
[color=blue]In mallmode, best MP restorative is: ancient Magi-Wipes @ 733.63635 meat total.[/color]
[color=green]Trying to use 5 ancient Magi-Wipes[/color]
Searching for "ancient magi-wipes"...
[color=red]Stopped purchasing ancient Magi-Wipes @ 190.[/color]
[color=red]Failed to use an item from the mall.[/color]
[color=blue]Current HP: 1108, MP: 374[/color]
[color=blue]In mallmode, best MP restorative is: ancient Magi-Wipes @ 929.27277 meat total.[/color]
_meatpermp => 3.4545455
[color=green]Trying to use 5 ancient Magi-Wipes[/color]
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (5 @ 190)...
You acquire ancient Magi-Wipes (5)
Purchases complete.
Using 5 ancient Magi-Wipes...
You gain 277 hit points
You gain 260 Muscularity Points
Finished using 5 ancient Magi-Wipes.
[color=blue]Current HP: 1108, MP: 634[/color]
[color=blue]In mallmode, best MP restorative is: ancient Magi-Wipes @ 31.090908 meat total.[/color]
[color=green]Trying to use 1 ancient Magi-Wipes[/color]
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 190)...
You acquire an item: ancient Magi-Wipes
Purchases complete.
Using 1 ancient Magi-Wipes...
You gain 59 hit points
You gain 52 Muscularity Points
Finished using 1 ancient Magi-Wipes.
[color=blue]Current HP: 1108, MP: 643[/color]
[color=green]My meat: 183196. Should be successfully healed...[/color]
 
Last edited:
Seems to have randomly stopped recovering me... not sure what happened. I was adventuring in the oasis, clicked the HP in the relay browser to recover and....

Purchasing some Knob Goblin seltzers for use as a combat restorative.
Searching for "knob goblin seltzer"...
Saving outfit Backup...
Outfit saved
Putting on Knob Goblin Elite Guard Uniform...
Equipment changed.
Purchasing Knob Goblin seltzer (1 @ 80)...
You acquire an item: Knob Goblin seltzer
You spent 80 Meat
Purchases complete.
Putting on Backup...
Equipment changed.
Restoring HP! Currently at 36 of 270 HP, 26 of 76 MP, current meat: 1468 ... Target HP = 270.
Restoring MP! Currently at 36 of 270 HP, 26 of 76 MP, current meat: 1468 ... Target MP = 32.

It just waits after that, some sort of loop. I tried restarting mafia, same problem.
 
Can I have a bit more information please: Do you have mall access? What triggered that healing? Do you have any healing skills? (Which ones?) How much meat do you have on hand?

Also, it really helps me if you turn up the verbosity to max. "Super Verbose" is basically the debugging setting.
 
It seems to have fixed itself, I'll remember the verbose mode and such if I run into the problem again

I triggered the heal myself by clicking the HP number link in the relay browser. I don't have mall access, I'm in BM. I have the 2 tongue skills as a SC, I had spleen left for herbs. I had enough meat to heal at the least.
 
Back
Top