Universal Recovery Script

Muhandes

Member
It tries to save the hot tub usage for times when you have less than 1/9 of your max hp to maximize their usefulness. Your examples showed me that was happening.

Whatever considerations are made for the hot tub, they are the same for the scroll, aren't they? I mean if 1/9 of max HP is the threshold for full HP recovery, isn't the scroll doing the same full recovery?

I personally always use the tub before using a scroll. I tend to get to the end of the day in HCO with tubs left.
 

Bale

Minion
Whatever considerations are made for the hot tub, they are the same for the scroll, aren't they? I mean if 1/9 of max HP is the threshold for full HP recovery, isn't the scroll doing the same full recovery?
I know that makes sense, but the logic gets a little more complicated than that. Perhaps someday I'll reorganize it to work that way, but right now it checks for 1/9 HP to use hot tub. Then it checks to see if your HP can be healed by a combination of various items in inventory. Then if you don't have enough of various restoratives it will decide to use a scroll as the last resort. It's not perfect and as I write this I'm thinking about ways to make it work the way you suggest...
 

Bale

Minion
Universal recovery v 3.533 released!


Changelog:
version 3.532 March 8, 2010
  • Fixed version update bug


Yay! The file name is correct again!
 
Last edited:
Code:
Restoring HP! Currently at 498 of 1167 HP, 249 of 285 MP, current meat: 20169190 ... Target HP = 1167.
Using 5 sugar shard...
You gain 85 hit points
You gain 38 Muscularity Points
Finished using 5 sugar shard.
Using 1 smoky potion of healing...
You gain 14 hit points
You gain 16 Muscularity Points
Finished using 1 smoky potion of healing.
Using 1 sugar shard...
You gain 20 hit points
You gain 10 Muscularity Points
Finished using 1 sugar shard.
_meatperhp => 0.15104894
Casting Cannelloni Cocoon 1 times...
You gain 550 hit points
Cannelloni Cocoon was successfully cast.

Er... it seems like it would be a little bit more efficient to just cast Cocoon, given that I have plenty of MP for it and I want to restore to 100%.
 

Bale

Minion
That is really weird. Were you in ronin/hardcore at that time? What other restoratives did you have in your inventory? Are there any strange settings you could make me aware of?
 
(Sorry about the slow reply; it was really very rude of me to post something and then just disappear!)

I was in aftercore, beatin' on hobos. I was set to auto-restore health at < 60%, all the way to 100%, and not to auto-recover MP (although I'm certainly okay with restoring MP to restore HP). Auto-remove malign status effects is off, although I doubt that's relevant.

Unfortunately because of my poor response time I can't say for certain what other restores were in my inventory. Probably a couple of scrolls of drastic healing. I do remember that after a while it stopped using items + Cocoon to recover and just used Cocoon, presumably having used up the other restores. I didn't see it use any restores beyond those two.

I've tried a couple quick tests:

- sugar shards in inventory:
Code:
Restoring HP! Currently at 676 of 1290 HP, 174 of 610 MP, current meat: 20590914 ... Target HP = 1290.
_meatperhp => 0.14154576
Casting Cannelloni Cocoon 1 times...
You gain 614 hit points
Cannelloni Cocoon was successfully cast.

- sugar shields + smoky potions (of healing)
Code:
Restoring HP! Currently at 344 of 684 HP, 186 of 313 MP, current meat: 20592078 ... Target HP = 684.
Using 17 sugar shard...
You gain 254 hit points
You gain 123 Muscularity Points
Finished using 17 sugar shard.
Using 1 smoky potion of healing...
You gain 15 hit points
You gain 16 Muscularity Points
Finished using 1 smoky potion of healing.
Using 1 sugar shard...
You gain 12 hit points
You gain 10 Muscularity Points
Finished using 1 sugar shard.
Casting Summon BRICKOs 1 times...
You acquire BRICKO brick (3)
Summon BRICKOs was successfully cast.
MP burning down to 30% (probably the same in the original example, but at that point I had exhausted my summons for the day). (Also, my big bad buff wore off. Oh well, made testing easier.)

Here it didn't cast Cocoon at all, which is weird since it didn't actually restore to 100%. And it's not like I didn't have more sugar shards it could have used if it wanted to go that route...

- closet remaining sugar shards, smoky potions in inventory
Code:
Restoring HP! Currently at 170 of 684 HP, 206 of 313 MP, current meat: 20592053 ... Target HP = 684.
_meatperhp => 0.15217546
Casting Cannelloni Cocoon 1 times...
You gain 514 hit points
Cannelloni Cocoon was successfully cast.

Okay, that's just bizarre. I would have guessed it was those smoky potions, but...

Note: sugar shards are at mallmin, so possibly valued as "worthless"? But smoky potions as of these experiments were not.

I hope this elucidates something for you. I will not ignore the Mafia forums for several days this time, so if you have more questions I hope I will be able to answer them quickly.
 

bumcheekcity

Active member
Bale, quick question. I'm in hardcore, in Day 1, and MP is the most important thing in the world to me at this point. Is it possible to somehow have the script NOT cast Disco Power Nap on the first day or something? I realise it's a bit specific, but I'd much rather that ointment was bought than MP was spent in the first day or two.
 

Bale

Minion
Bale, quick question. I'm in hardcore, in Day 1, and MP is the most important thing in the world to me at this point. Is it possible to somehow have the script NOT cast Disco Power Nap on the first day or something? I realise it's a bit specific, but I'd much rather that ointment was bought than MP was spent in the first day or two.
There's no way to have my script do that.

Disco Power Nap costs 12 MP. That would cost 204 meat to restore using Doc Galaktik.
The nap would restore 40 HP. That would cost 400 meat to restore using Doc Galaktik.

Are you really sure that you'd want to spend twice as much meat, just to avoid casting a spell? If you were only able to restore 20HP because of maxHP, you'd still break even. I feel no incentive to make that possible so if you really like that method, just disable my script and set up mafia's default healing since it is quite capable of doing that.

If you'd give me an example of how my logic is wrong, perhaps I can be swayed.
 

lostcalpolydude

Developer
Staff member
Actually, with doc you can buy an ailment ointment (60 meat) to restore 8-10 HP. So you can restore 24-30 HP for 180 meat, but restoring 40 HP would be more cheaply done with DPN. The only time doc's 10 meat per HP option makes any sense is if you want to restore < 4 HP (at 3 HP you do it that way because it's fewer server hits for the same result as pungent unguent)
 

bumcheekcity

Active member
There's no way to have my script do that.

Disco Power Nap costs 12 MP. That would cost 204 meat to restore using Doc Galaktik.
The nap would restore 40 HP. That would cost 400 meat to restore using Doc Galaktik.

Are you really sure that you'd want to spend twice as much meat, just to avoid casting a spell? If you were only able to restore 20HP because of maxHP, you'd still break even. I feel no incentive to make that possible so if you really like that method, just disable my script and set up mafia's default healing since it is quite capable of doing that.

If you'd give me an example of how my logic is wrong, perhaps I can be swayed.

Oh no, you're right. If the script spends xMP, then I can always restore that amount of MP later with the meat anyway. Yeah, that's daft. Ignore me :p
 

Bale

Minion
"Not purchasing from the mall" IS the default, now.
I've actually never turned it on...
By contrast, I couldn't imagine aftercore without mall integration. I keep no expendables in my post-prism inventory, so I rely on it for almost everything.
 

Bale

Minion
Oh no, you're right. If the script spends xMP, then I can always restore that amount of MP later with the meat anyway. Yeah, that's daft. Ignore me :p
Sorry, but I'm not ignoring you. You got me thinking that in some cases where amount of HP to restore is less than the maximum that a skill would heal or you don't have access to seltzer (or MMJ), then the cost of restoring with ailment ointments could be less than the cost of restoring the MP. Okay, that's not likely to happen when you have seltzer or better, but it is possible if you haven't gotten access to seltzer yet.

I'm adding a check for that in the next version.
 

AlbinoRhino

Active member
I ascended into HCO Pastamancer yesterday and I noticed that the script attempts to buy MMJ, twice, after every round of combat even though I haven't opened Gouda's yet.

Like so, when the mana burner acts :

Code:
You gain 13 Meat
You acquire an item: rat whisker
You acquire an item: rat appendix
You gain 1 Strengthliness
You gain 1 Enchantedness
Purchasing some magical mystery juices for use as a combat restorative.
Searching for "magical mystery juice"...
Purchasing magical mystery juice (2 @ 100)...
Desired purchase quantity not reached (wanted 2, got 0)
Casting Advanced Saucecrafting 1 times...
You acquire an item: scrumptious reagent
Advanced Saucecrafting was successfully cast.
Casting Summon Party Favor 1 times...
You acquire an item: divine can of silly string
Summon Party Favor was successfully cast.
Purchasing some magical mystery juices for use as a combat restorative.
Searching for "magical mystery juice"...
Purchasing magical mystery juice (2 @ 100)...
Desired purchase quantity not reached (wanted 2, got 0)
And, even when the mana burner does not :
Code:
You acquire an item: rat whisker
You gain 2 Strengthliness
You gain 2 Magicalness
You gain 1 Cheek
Purchasing some magical mystery juices for use as a combat restorative.
Searching for "magical mystery juice"...
Purchasing magical mystery juice (2 @ 100)...
Desired purchase quantity not reached (wanted 2, got 0)
Purchasing some magical mystery juices for use as a combat restorative.
Searching for "magical mystery juice"...
Purchasing magical mystery juice (2 @ 100)...
Desired purchase quantity not reached (wanted 2, got 0)
Is this the intended behavior ? Does the script not know whether Gouda's has been opened ?
 

slyz

Developer
Code:
if(buy_mmj && !guild_store_available()) {
	if(my_level() > 3 && start_type == "MP") 	// Best remind the player he should open his guild store already
		print("You'd be able to purchase magical mystery juice if you opened your guild store", "red");
	buy_mmj = false;
}
This part of the script takes care of checking whether you have access to MMJ or not, and even warns you if can open your guild store but didn't. I guess Mafia didn't reset everything after you ascended.

I always restart Mafia after ascending, although there shouldn't be a problem, even if you ascended outside of Mafia and started using mafia afterwards.

What does the CLI return when you type get knownAscensions and get lastGuildStoreOpen in the gCLI? You should have a different number, if you didn't open the guild store yet. If you did, you should get the same number, like this:
Code:
> get knownAscensions

27

> get lastGuildStoreOpen

27
 

AlbinoRhino

Active member
I did restart Mafia after ascending. I always do this too. In fact, I played a different character from a different copy of mafia for a while (I use a separate copy of the .jar for each character) and came back to this one later. Using r8298, Win XP, FF 3.6 ... if any of that's of any help.

Code:
> get knownAscensions

47

> get lastGuildStoreOpen

47
However, I still haven't opened Gouda's. Maybe it will straighten out after I do. I assume it will, since it will finally be able to buy the MMJ it wants. :p

Edit: Also, I am level 4 and haven't seen the reminder to open the guild store appear.
 
Last edited:
Top