Universal Recovery Script

Something weird happened while I was fighting the NS. Not sure if it was down to this script or mafia but here's what happened. Fighting 2nd form, everything going well, click to shieldbutt. Page refreshes and I'm back at the main map with beaten up. Meanwhile mafia's repeating this endlessly:
Code:
(usable quantity of Monstar energy beverage is limited to 0 by needed restoration)
(usable quantity of natural fennel soda is limited to 0 by needed restoration)

Here's the relevant part of my log:
Code:
[872] Sorceress Tower: Naughty Sorceress
Encounter: The Naughty Sorceress
Round 0: banana lord loses initiative!
You lose 19 hit points
Round 1: banana lord casts SHIELDBUTT!
Round 2: With a queftick swipe of his hugantic claw, Odusseia smacks your shield and sends you spyrating around, raising a thick cloud of smust.
Round 2: banana lord casts SHIELDBUTT!
Round 3: banana lord casts SHIELDBUTT!
Round 4: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 11 damage.
Round 4: banana lord casts ENTANGLING NOODLES!
Round 5: Odusseia grabs the end of one of the noodles in his mouth and gleerfully stromples around your opponent, pulling the noodles even tighter.
Round 5: banana lord casts SHIELDBUTT!
Round 6: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 8 damage.
Round 6: banana lord casts SHIELDBUTT!
Round 7: banana lord casts SHIELDBUTT!
Round 8: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 10 damage.
Round 8: banana lord casts SHIELDBUTT!
Round 9: banana lord casts SHIELDBUTT!
You lose 11 Mana Points
Round 10: banana lord casts SHIELDBUTT!
You lose 12 hit points
Round 11: banana lord casts SHIELDBUTT!
Round 12: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 15 damage.
Round 12: banana lord casts SHIELDBUTT!
You lose 16 Mana Points
Round 13: banana lord casts SHIELDBUTT!
Round 14: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 7 damage.
After Battle: Odusseia smaughs happily while the jub-jub bird makes a mystic hand gesture at you.  Okay, well, more of a wing gesture.
 > Restoring HP! Currently at 152 of 180 HP, 467 of 577 MP, current meat: 19884 ... Target HP = 180.
 > Restoring MP! Currently at 152 of 180 HP, 467 of 577 MP, current meat: 19884 ... Target MP = 553.

use 1 Monstar energy beverage
Encounter: The Naughty Sorceress (2)
Round 0: banana lord loses initiative!
You lose 24 hit points
Round 1: banana lord casts ENTANGLING NOODLES!
You lose 18 Mana Points
Round 2: banana lord casts SPRING RAINDROP ATTACK!
You lose 21 hit points
Round 3: banana lord casts SHIELDBUTT!
You lose 21 hit points
Round 4: banana lord casts SHIELDBUTT!
You lose 22 hit points
Round 5: banana lord casts SHIELDBUTT!
Round 6: With a queftick swipe of his hugantic claw, Odusseia smacks your shield and sends you spyrating around, raising a thick cloud of smust.
Round 6: banana lord casts SHIELDBUTT!
Round 7: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 15 damage.
Round 7: banana lord casts SHIELDBUTT!
Round 8: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 11 damage.
Round 8: banana lord casts SHIELDBUTT!
Round 9: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 7 damage.
Round 9: banana lord casts SHIELDBUTT!
You lose 17 hit points
Round 10: banana lord casts SHIELDBUTT!
Round 11: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 14 damage.
Round 12: banana lord casts SHIELDBUTT!
Round 13: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 10 damage.
Round 13: banana lord casts SHIELDBUTT!
Round 13: banana lord casts SHIELDBUTT!
You lose 23 hit points
Round 15: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 11 damage.
Round 15: banana lord casts SHIELDBUTT!
You lose 20 hit points
Round 16: banana lord casts SHIELDBUTT!
Round 17: With a quick swipe of one monscular wing, Odusseia smacks your shield and sends you spinning back into your opponent, doing 9 damage.
You lose 21 hit points
Round 0: banana lord casts SHIELDBUTT!

use 1 bottle of Monsieur Bubble
You gain 49 Mana Points

uneffect Beaten Up
 > Restoring HP! Currently at 0 of 180 HP, 409 of 577 MP, current meat: 19884 ... Target HP = 180.
 > Restoring MP! Currently at 0 of 180 HP, 409 of 577 MP, current meat: 19884 ... Target MP = 553.

use 1 natural fennel soda
You gain 111 Mana Points

buy 4 black cherry soda at market price from Black Market
You acquire black cherry soda (4)
You spent 320 Meat

use 4 black cherry soda
You gain 38 Mana Points

Visiting Relaxing Hot Tub in clan VIP lounge
You gain 180 hit points
 > You'd be able to purchase magical mystery juice if you opened your guild store
 > Restoring MP! Currently at 180 of 180 HP, 558 of 577 MP, current meat: 19564 ... Target MP = 577.

buy 2 black cherry soda at market price from Black Market
You acquire black cherry soda (2)
You spent 160 Meat

use 2 black cherry soda
You gain 20 Mana Points

It looks like mafia started using my CCS, but I'm 100% certain I didn't tell it to, or click int he wrong place. But that wouldn't be an issue with your script right? The thing that made me post here was the "usable quantity" loop I posted first.
 
Last edited:
Is that the only relevant part of your log? How does it get from there to the error? What is MP restoration set to? (and I suppose this is none of my business, but why are you restoring HP when you're at 85% of max HP?)
 
I assume it's the only relevant part. Up until then everything was going fine. Although afterwards, when I refought the NS, I beat her 2nd form, and got dumped at the main main again without ever seeing her 3rd form. When I went back to the top of the tower the prism was there though, so evidentially I beat her. The error occurs immediately after noodles (2nd form). At that point I clicked shieldbutt, and got dumped at the main map. The logs don't show that though, they show me getting beaten up. MP and HP were set to restore at 95% (to 100%). And the only reason for that is that at the tail end of a successful ascension, not much can go wrong so I generally set mafia to keep me at ~100% HP/MP. Call me lazy but it just saves me having to think about restoring before I fight my Shadow and then the NS.
 
Although afterwards, when I refought the NS, I beat her 2nd form, and got dumped at the main main again without ever seeing her 3rd form

Mafia doesn't know about multi-fight monsters (Ed, the NS, your Nemesis...), so once the first fight is won, it will try restoring as usual, but will of course be redirected to a fight page.

In the case of the NS's third form, since it's not a fight, but simply a page, after the restoration you will be send back to the main page, since the restoration process passed that page without mafia showing it to you.
 
That makes a whole lot of sense now that I think about it. But it doesn't explain why mafia started using my CCS by itself, or why universal recovery looped (of course, that's only an assumption, it may have nothing to do with the script).

Thanks Slyz!
 
Mafia doesn't know about multi-fight monsters (Ed, the NS, your Nemesis...), so once the first fight is won, it will try restoring as usual, but will of course be redirected to a fight page.
So I'm confused. Does this mean I should somehow disable the URS before fighting the NS? I don't seem to recall having any problems with it and Ed and the fact that my Nemesis remains undefeated is unrelated to recovery scripts. Thanks.
 
It won't work just like the default healing won't work. Same problem.

Got it. Thanks. The original post made it sound as if URS tried to do something between monster forms that caused the fight to begin/progress and thus contribute to a premature or unnecessary defeat. That doesn't seem to be the case.
 
Universal recovery v 3.6 released!
This version requires a recent build of kolMafia: download here!

Changelog:
version 3.6 April 13, 2010
  • Adds UI for preferences in relay browser
  • Makes use of new price sharing list at kolmafia.us
  • Improved checks for meat per mp to update when access to lab or mmj is achieved
  • Fixed cases where cost of restoring MP for a healing spell could be higher than cost of purchasing HP with meat



Note that there are two files to download instead of only one! Download relay_Universal_Recovery to the /relay directory for a brand new configuration user interface in the relay browser! The relay browser script is optional, but it does include a few options to configure this script that are not otherwise available.

Note that control over recovery options like the thresholds for restoration and configurable restores can now be set in either the relay browser or the mafia window, so use the one you like the best.
 
Last edited:
I see that it works even without jasons html-augmenting scripts. Is this because you have imported the nessecary functions into your own script or have you built new ones? *curious* :)
 
I see that it works even without jasons html-augmenting scripts. Is this because you have imported the nessecary functions into your own script or have you built new ones? *curious* :)

Copy-paste from htmlform. I like to keep the necessary number of downloads to a minimum and jason suggested that it was fine to copy-paste his functions so I took him up on it. He's credited in my comments to satisfy my own sense of propriety.
 
To clarify, are the relay override options at the bottom universally used by all accounts or do I need to set them for each account now? I used to set them in the script itself and knew all my accounts would adhere. Now when I load the relay override for the first time on any given account, those settings are not pre-selected as to my preferences set with the prior account. If it's account by account, cool, I just want to make sure I'm doing the right thing :)
 
You should have removed my database from this script. Price sharing is on kolmafia.us now; I will be deleting the script from my server in a week or so, to allow PriceGun users time to update.
 
You should have removed my database from this script. Price sharing is on kolmafia.us now; I will be deleting the script from my server in a week or so, to allow PriceGun users time to update.
Okey-doke. I removed it now. I had thought it might be good as a backup, but future downloaders will no longer make use of it.

If it's account by account, cool, I just want to make sure I'm doing the right thing :)
It is by account now, not global. The good news is that they'll be saved so that you will no longer need to edit my script every single time you upgrade. Since you're the number one user of those options, let me know if it does what you need.
 
Is there a way to get mafia to take my oscus soda out of my DC automatically? Or Even detect and take out items from my DC when needed?
 
In general, mafia is set up such that it will automatically take things that may be useful from Hagnk's if you don't have pull restrictions, but it will leave stuff in your DC as-is. It's a core philosophy thing (it's nice to have one place you can put things where you can be fairly rest-assured that mafia won't "mess" with them).

I would suggest either setting up an alias to pull your soda, or leaving it in Hagnk's / your closet / your inventory.
 
Is there a way to get mafia to take my oscus soda out of my DC automatically? Or Even detect and take out items from my DC when needed?

First of all, I don't know that really has anything to do with my script since most people would be irked it it started to mess with their display cases.

Putting that aside, there is no way to trigger a script to run automatically when you break the prism. You'll have to follow StDoodle's advice to create a script or alias to manually run when you break the prism and then trigger it yourself.
 
I don't know if this is an error in yoru script or somewhere else but if I click "Use MMJ in stock even if you can't buy any this ascencion" and I do in fact not have any in stock it tries to buy some anyway between each battle. Unticking that box removes the problem.
 
Back
Top