Universal Recovery Script

Spiny

Member
And more! In regular verbose mode, while autoadventuring and my CCS not efficiently doing what I'd hoped due to fumbling. This is an auto-restore:

Code:
Restoring HP! Currently at 149 of 1389 HP, 764 of 1526 MP... Target HP = 1389, current meat: 50594.
Restoring MP! Currently at 149 of 1389 HP, 764 of 1526 MP... Target MP = 783, current meat: 50594.
In mallmode, best item is: magical mystery juice @ 1792.941
Using 18 magical mystery juice
Purchasing magical mystery juice (18 @ 100)...
You acquire magical mystery juice (18)
Purchases complete.
Using 18 magical mystery juice...
You gain 753 Mana Points
Finished using 18 magical mystery juice.
Current HP: 149, MP: 1517
In mallmode, best item is: magical mystery juice @ 21.176472
Using 1 magical mystery juice
Purchasing magical mystery juice (1 @ 100)...
You acquire an item: magical mystery juice
Purchases complete.
Using 1 magical mystery juice...
You gain 43 Mana Points
Finished using 1 magical mystery juice.
Current HP: 149, MP: 1526
My meat: 48694. Should be successfully healed...
In mallmode, best item is: scroll of drastic healing @ 330.0
In mallmode, best item is: magical mystery juice @ 896.4705
Mall price to restore 20MP is 48 meat.
Cast a healing skill.
Casting Cannelloni Cocoon 1 times...
You gain 1,240 hit points
Cannelloni Cocoon was successfully cast.
Current HP: 1389, MP: 1506
My meat: 48694. Should be successfully healed...

Why'd it buy 18 MMJ and then another MMJ separately? *ponders* Is the intent to get to full mana, cast cocoon and then buy 1 MMJ to restore the lost MP back? I hadn't seen this before...

-Spiny
 

Bale

Minion
I think I follow all that you're saying about finetuning verbose responses to be more informative. (Though I'll admit my enthusiasm for doing something that doesn't actually improve the script's function is low.)

You explained "it checks your MP to see if the cost of a healing spell will reduce your MP below your MP healing trigger." This made sense to me, but doesn't rectify that the script reports the trigger MP rather than the true target MP in the restore both/restore hp (where my_mp < Trigger MP %) scenario.
The target (which it reports) should be your trigger MP plus 20. Looking at your examples, it seems something weird is going on. I'll look into that.
 

Spiny

Member
I think I follow all that you're saying about finetuning verbose responses to be more informative. (Though I'll admit my enthusiasm for doing something that doesn't actually improve the script's function is low.)
Understood. No worries. You've busted tail getting it functional for me where it wasn't functional before. As I said, it was mere cosmetics I was mentioning ;)

The target (which it reports) should be your trigger MP plus 20. Looking at your examples, it seems something weird is going on. I'll look into that.

This is probably ok as is.

For what it's worth, I really do think you rock and a lot of my criticisms are grounded in my history as a proofreader and bean counter. I used to get paid to make sure every "c" was a "c" and not an "e" and all "i"s and "l"s were not "1"s, etc. In short, these various cosmetic things are probably only going to be noticeable to someone who scrutinizes over little things the way I do. Most folks wouldn't notice I'd guess.

-Spiny
 

notusername

New member
Thanks for the quality script. There are a couple minor issues I've found that I thought you might like to know about:

- When ascending as a Myst class, the script attempts to buy MMJ from the guild store for in-combat restorative purposes before the store has been unlocked, aborting with an error along the lines of "you are not yet out of ronin". It appears that because reserve_healing() is called before the actual MP restoration routine in main(), and guild_store_available() is only checked in that portion of main() rather than in buy_mmj() (which only checks that you are Myst or level >9 AT), the script is unable to do anything when no reserve items are on hand and MMJ is going to become available in future. Of course, it works fine if you just unlock the store, but one is not always able to do that right away.

- The visit_nuns() check for Frat Warrior inaccessibility is not quite complete: using a Spooky Putty sheet, it is possible to complete the nuns as a Frat Warrior before the area is unlocked with the Frat Warrior uniform. The function only removes the Frat outfit to use the nuns if it is completed as a hippy and the zone has not yet been unlocked as a frat, so the script attempts to just visit the nuns after every combat while still wearing the frat outfit (and having completed the zone as a frat but not yet having unlocked it). It would probably work if sidequestNunsCompleted checked for both hippy and frat cases while hippiesDefeated was less than 192.
 
Last edited:

Bale

Minion
I'd just caught that problem with the MMJ myself. Good eyes.

Another good point about the nuns problem. I'll be right on that. Interesting that you pointed out this problem with nun recovery just aftter I finally "fixed" gnaddelwarz's problem with properly making use of the nuns healing if you have completed it as a hippy and your HP > 1000.

Probably issuing another release soon to fix these problems.
 
Last edited:

shoptroll

Member
For some reason the script is choosing Doc over my clan's VIP Hot Tub despite having pulled the key from Hagnk's yesterday. Right now i have Mafia's restoration set to auto-recover @ 30% HP, and restore to 100%.

Love the script, thanks for all the hard work!
 

StormCrow42

Member
For some reason the script is choosing Doc over my clan's VIP Hot Tub despite having pulled the key from Hagnk's yesterday. Right now i have Mafia's restoration set to auto-recover @ 30% HP, and restore to 100%.

The script is configured to only use the hot tub to cure beaten up, poisoned if you're below 1/6th HP, or if you're below 1/9th HP.
 

Bale

Minion
As StormCrow42 says. Since you only get 5 visits a day, the script tries to use them when you'll get the most use out of them.

If your HP never get below 30% then you'd never use the Hot Tub. However, if a monster gets in a few lucky hits and your HP drop to 11% or you get beaten up, then it will decide to use the Hot Tub.
 

th3y

Member
If your HP never get below 30% then you'd never use the Hot Tub.


It's not uncommon for me to finish the day with Hot Tub rests left over. A suggestion: as you get low on remaining turns, increase priority of the Hot Tub so you don't end the day with "wasted" opportunities.


Example logic:

first, estimate "expected advs remaining" along these lines:
(in HC/ronin) actual advs remaining + 3.5 * remaining fullness + 3.5 * remaining drunkenness + 1.75 * remaining spleen

then, if (expected advs remaining) < (10 * Hot Tub remaining) , increase priority of Hot Tub


In other words, burn a Hot Tub if you have 5 Hot Tubs remaining with less than (for example) 50 expected advs remaining; or 4 or more Hot Tubs remaining with less than 40 expected advs, etc.


That's what TH3Y think
 

Bale

Minion
That's an excellent idea. I've added it exactly like that.


Universal recovery v 3.33 released!


Changelog:
version 3.33 August 26, 2009
  • Improved clarity of verbose mode
  • Improvement to Hot Tub usage
  • Improvement to using Nuns for HP restoration
  • Bugfix for using Nuns to restore after the putty trick
  • Fix for r7570's mall_price() change
  • Can remove need for user confirmation if version increases low decimals
 
Last edited:

shoptroll

Member
The script is configured to only use the hot tub to cure beaten up, poisoned if you're below 1/6th HP, or if you're below 1/9th HP.

Ahhh that explains why I was seeing it activating on day 1 (when I had little HP) and didn't see it at all yesterday.

Looking forward to trying the new version tonight. Thanks again Bale!
 

Bale

Minion
You're welcome. Thanks to the idea that TH3Y had, you should see a lot more Hot Tub usage when you start running low on turns.
 

Spiny

Member
I rolled back to the prior version cos something is not right with the new one, presumedly on account of the mall_price() fix?

New version, super-verbose mode with zero meat on hand, restore mana trigger set to not restore in order to avoid mana restoration altogether for the purposes of testing restore hp alone.

Code:
> restore hp

_BalesUniversalRecovery => 3.33
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 HP! Currently at 628 of 1273 HP, 531 of 1836 MP... Target HP = 1273, current meat: 0.
To heal with Doc Galaktik would cost 3870.0 meat. Now to beat that price...
testing... Marquis de Poivre soda
testing... Medicinal Herb's medicinal herbs
testing... Xlyinia's notebook
testing... magical mystery juice
testing... personal massager
Could heal 645HP with 72 personal massager for 0.0 meat.
In mallmode, best HP restorative is: Doc Galaktik's services. Huh?
Restoring with Doc Galaktik
Current HP: 628, MP: 531
To heal with Doc Galaktik would cost 3870.0 meat. Now to beat that price...
testing... Marquis de Poivre soda
testing... Medicinal Herb's medicinal herbs
testing... Xlyinia's notebook
testing... magical mystery juice
testing... personal massager
Could heal 645HP with 72 personal massager for 0.0 meat.
In mallmode, best HP restorative is: Doc Galaktik's services. Huh?
Restoring with Doc Galaktik
Current HP: 628, MP: 531
To heal with Doc Galaktik would cost 3870.0 meat. Now to beat that price...
testing... Marquis de Poivre soda
testing... Medicinal Herb's medicinal herbs
testing... Xlyinia's notebook
testing... magical mystery juice
testing... personal massager
Could heal 645HP with 72 personal massager for 0.0 meat.
In mallmode, best HP restorative is: Doc Galaktik's services. Huh?
Restoring with Doc Galaktik
Current HP: 628, MP: 531
My meat: 0. Sadly I think healing failed...
Did not fully restore HP for some reason.

After rolling back to prior version:

Code:
> restore hp

_BalesUniversalRecovery => 3.3
New version available: 3.33
Already updated from http://nixietube.info/mallprices.txt in this session.
Already updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap in this session.
Pricelist updated.
Restoring HP! Currently at 628 of 1273 HP, 531 of 1836 MP... Target HP = 1273, current meat: 0.
To heal with Doc Galaktik would cost 3870.0 meat. Now to beat that price...
testing... Blatantly Canadian
testing... Cherry Cloaca Cola
testing... Cloaca-Cola
testing... Diet Cloaca Cola
testing... Doc Galaktik's Ailment Ointment
Could heal 645HP with 72 Doc Galaktik's Ailment Ointment for 4300.0 meat.
testing... Doc Galaktik's Homeopathic Elixir
Could heal 645HP with 34 Doc Galaktik's Homeopathic Elixir for 8147.3687 meat.
testing... Doc Galaktik's Pungent Unguent
Could heal 645HP with 162 Doc Galaktik's Pungent Unguent for 4837.5 meat.
testing... Doc Galaktik's Restorative Balm
Could heal 645HP with 47 Doc Galaktik's Restorative Balm for 5528.572 meat.
testing... Dyspepsi-Cola
testing... Knob Goblin seltzer
testing... Knob Goblin superseltzer
testing... Marquis de Poivre soda
testing... Medicinal Herb's medicinal herbs
testing... Monstar energy beverage
testing... Mountain Stream soda
testing... Nardz energy beverage
testing... New Cloaca-Cola
testing... Regular Cloaca Cola
testing... Wint-O-Fresh mint
testing... Xlyinia's notebook
testing... ancient Magi-Wipes
Could heal 645HP with 12 ancient Magi-Wipes for 1759.091 meat.
ancient Magi-Wipes is now the best for restoring HP.
testing... ancient turtle shell powder
Could heal 645HP with 9 ancient turtle shell powder for 76903.84 meat.
testing... black cherry soda
testing... blue pixel potion
testing... bottle of Monsieur Bubble
testing... bottle of Vangoghbitussin
Could heal 645HP with 7 bottle of Vangoghbitussin for 4508.55 meat.
testing... carbonated soy milk
testing... carbonated water lily
testing... cast
Could heal 645HP with 37 cast for 3685.7144 meat.
testing... cotton candy bale
Could heal 645HP with 11 cotton candy bale for 5243.9023 meat.
testing... cotton candy cone
Could heal 645HP with 17 cotton candy cone for 6615.385 meat.
testing... cotton candy pillow
Could heal 645HP with 13 cotton candy pillow for 4742.647 meat.
testing... cotton candy pinch
Could heal 645HP with 72 cotton candy pinch for 229333.33 meat.
testing... cotton candy plug
Could heal 645HP with 23 cotton candy plug for 73213.16 meat.
testing... cotton candy skoshe
Could heal 645HP with 29 cotton candy skoshe for 11466.666 meat.
testing... cotton candy smidgen
Could heal 645HP with 38 cotton candy smidgen for 15176.471 meat.
testing... delicious shimmering moth
testing... filthy poultice
Could heal 645HP with 7 filthy poultice for 1290.0 meat.
filthy poultice is now the best for restoring HP.
testing... forest tears
Could heal 645HP with 86 forest tears for 83420.0 meat.
testing... gauze garter
Could heal 645HP with 7 gauze garter for 1096.5 meat.
gauze garter is now the best for restoring HP.
testing... green pixel potion
Could heal 645HP with 13 green pixel potion for 7095.0 meat.
testing... high-pressure seltzer bottle
testing... honey-dipped locust
Could heal 645HP with 19 honey-dipped locust for 4238.5713 meat.
testing... magical mystery juice
testing... mummy wrapping
Could heal 645HP with 12 mummy wrapping for 2345.4546 meat.
testing... murky potion
Could heal 645HP with 65 murky potion for 19930.5 meat.
testing... natural fennel soda
testing... palm frond
Could heal 645HP with 33 palm frond for 4837.5 meat.
testing... palm-frond fan
Could heal 645HP with 17 palm-frond fan for 6127.5 meat.
testing... personal massager
Could heal 645HP with 72 personal massager for 0.0 meat.
testing... phonics down
Could heal 645HP with 14 phonics down for 3090.625 meat.
testing... pixellated candy heart
Could heal 645HP with 144 pixellated candy heart for 93166.664 meat.
testing... plump juicy grub
testing... really thick bandage
Could heal 645HP with 6 really thick bandage for 2210.591 meat.
testing... red pixel potion
Could heal 645HP with 6 red pixel potion for 6450.0 meat.
testing... scented massage oil
Could heal 645HP with 1 scented massage oil for 6900.0 meat.
testing... scroll of drastic healing
Could heal 645HP with 1 scroll of drastic healing for 333.33334 meat.
scroll of drastic healing is now the best for restoring HP.
testing... six-pack of New Cloaca-Cola
testing... soda water
testing... tiny house
Could heal 645HP with 30 tiny house for 6274.091 meat.
testing... tonic water
testing... unrefined Mountain Stream syrup
In mallmode, best item is: scroll of drastic healing @ 333.33334
Using 1 scroll of drastic healing
Using 1 scroll of drastic healing...
Finished using 1 scroll of drastic healing.
Current HP: 1273, MP: 531
My meat: 0. Should be successfully healed...

I noticed you added the verbose tweaks in the new version, thanks for that. Now what do I need to do to get the new version to heal properly for me? :) I did do my usual tweaks as far as mall purchasing goes.

-Spiny
 

Bale

Minion
I rolled back to the prior version cos something is not right with the new one, presumedly on account of the mall_price() fix? Now what do I need to do to get the new version to heal properly for me? :)
Heck! Heck, heck, smurk, dargnab, floop, heck! Stupid Typo!


Universal recovery v 3.333 released!


Changelog:
version 3.333 August 26, 2009
  • Stupid Typo!


In case anyone is wondering, "3" is my favorite number.
 
Last edited:

Bale

Minion
I'm glad you laughed at my breakdown. I can assure you that my verbal language was even more colorful, but my fingers were much too polite to transcribe the entire tirade.
 

Spiny

Member
I'm glad you laughed at my breakdown. I can assure you that my verbal language was even more colorful, but my fingers were much too polite to transcribe the entire tirade.

It was the colorful words that was funny, NOT the reason behind the colorful words. Not by any means. I know how frustrating typos can be.

-Spiny
 

Spiny

Member
Hey Bale
What is this and how does it work?
Get Steel Organ

I think that's a feature Bale implemented so that after you've gotten the third Azazel piece, Azazel's Tutu, the script provides you with an 8-turn counter, which should be sufficient to get the Bureacracy of the Damned adventure should you decide to adventure elsewhere during those turns. It's merely informational.

-Spiny
 

Bale

Minion
As Spiny says, it's purpose is to warn you to return to the Friars for the steel organ. If you're like me you'd leave the Friar's Gate after getting the Tutu and spend the next 8 turns elsewhere. If you're not like me, then just ignore the counter and it will go away after 8 turns.

You see, KoL has an invisible counter that limits how often you can get the chance to go see Azazel. If you return after 8 turns you are GUARANTEED that the adventure will show up immediately. :D Funsies! I like not having to spend those turns in the Friar's Gate since there are usually other things I'd like to do.

The script makes that counter automatic because sometimes I forget to return for my steel organ until I run out of turns. Then I hate myself. :( This way I don't have to hate myself.
 
Top