Universal Recovery Script

I've noticed in the last week or two that _meatpermp is sometimes set to a ridiculously low value.

_meatpermp => 1.5000001E-5
_meatperhp => 6.6666665
_version_BalesUniversalRecovery => 3.81
Restoring MP! Currently at 77 of 78 HP, 23 of 106 MP, current meat: 19787 ... Target MP = 49.
Using 2 magical mystery juice...
You gain 28 Mana Points
Finished using 2 magical mystery juice.

Note that the actual value of _meatpermp here is 200/28 = 7.142857. After casting Ode, I tried running it again in the hopes it would reset itself to the correct value:

> restore mp

Restoring MP! Currently at 77 of 78 HP, 2 of 106 MP, current meat: 19787 ... Target MP = 3.
Using 1 magical mystery juice...
You gain 13 Mana Points
Finished using 1 magical mystery juice.

...but no luck. What information do you need to debug this? This character is a sauceror in Ronin, guild store unlocked.

Erroneously low values for _meatpermp really screw up SS -- when this happens it usually decides to attack rather than stasis, even with a 60-lb NPZR!
 
I'd imagine changing the following lines would at least allow you to start this whole bug tracing business:
PHP:
	if(type == "MP")
		set_property("_meatpermp", to_string((best_item == $item[magical mystery juice]
		  ? 100.0 : item_price(best_item))/ heal[best_item].avemp));
PHP:
	if(type == "MP") {
                print("Best item: "+best_item+"; Price: "+item_price(best_item)+"; Average MP: "+heal[best_item].avemp);
		set_property("_meatpermp", to_string((best_item == $item[magical mystery juice]
		  ? 100.0 : item_price(best_item))/ heal[best_item].avemp));
	}
 
heeX3 is right for aftercore. (I assume you're in aftercore?)

WTF was I thinking with that code? It would make so much more sense to roll the mmj check into item_price(). God that looks stupid! On the other hand... Oh heck, if I changed it in item_price(), then it would interfere with the (UseInventoryInMallmode && item_amount(it) > 0) decision for preferring inventory... Urgh. I guess it stays that way for now.
 
Well, for ronin you'd also want to fix meatpermp() like this:

Code:
// This returns meat per mp in hardcore. Use with: set_property("_meatpermp", meatpermp());
string meatpermp() {
string troubleshoot(string r; float test) {
print(r+"for mp, avemp: "+test);
return test.to_string();
}
	switch {
	case buy_mmj:
		return troubleshoot("mmj", 100.0/ heal[$item[magical mystery juice]].avemp);
	case black_market_available():
		return troubleshoot("bcs", 80.0/ heal[$item[black cherry soda]].avemp);
	case dispensary_available():
		return troubleshoot("ks", 80.0/ heal[$item[knob seltzer]].avemp);
	case white_citadel_available():
		return troubleshoot("cc", 80.0/ heal[$item[Regular Cloaca Cola]].avemp);
	case galaktik_cures_discounted():
		return troubleshoot("galaktik", 12.0);
	}
	return troubleshoot("galaktik", 17.0);
}
 
You probably have Mafia set to autoremove malignant effects, which it will then do and this might interfere with UR.

Yeah, sometimes I think that this script should come with a big red warning label to change that setting in mafia. I'd have my script change it, but it is a global setting that effects characters who might not be using the recovery script.

Now that I'm handling some of the most troublesome malignant effects, perhaps I should turn it off and the heck with anyone who only uses the script for some of his characters?

Perhaps a feature request to make the setting per character rather than global is in order? Implementing it is within my skill set if it is deemed A Good Idea ;-)
 
I didn't follow that ^^
Since the monsters are scaling, the script's options are:
- de-debuff: increase monster HP, increase stat experience
- don't debuff: leave monsters about as "weak" as you, leave reduced stats

Maybe these options should be in regular Mafia? "Remove malignant status in noncombat zones" and "even during holidays"?

I don't follow. Why is that better? And which are the top most effective healing items?
Daily "mallsearch everything" is a bit of a bother (some of us still have DSL!), as well as possibly causing extra server hits (for some server).

The efficiency of healing items are calculated by your script, aren't they? Some (like drastic healing) should probably always be considered due to variable efficiency, but "cast" at 100HP isn't likely to become more efficient than the top 5 fixed-efficiency options in the next week.
 
Universal recovery v 3.82 released!


Changelog:
version 3.82 March 5, 2011
  • Fixed very unpleasant bug caused by malignant effect removal with insufficient mana. I really hope it didn't bite anyone other than me.
 
Last edited:
I got tetanus and it actually went into an endless loop of using black cherry soda to fuel endless disco power naps. It was like a nightmare! I lost over a thousand meat before I stopped it.
 
Universal recovery v 3.83 released!


Changelog:
version 3.83 March 10, 2011
  • Fixed bug with purchasing reserve combat reserve
 
Last edited:
A sugar shard in the inventory has a lower meat value than one in the mall, similar to grub and moth for birdform. I had the impression that you handled those differently.

I can think of using an in-inventory delicious grub's autosell value as its "cost" (in which case it's more efficient than a 1000-meat full heal up to 30k HP). Sugar shard is non-discardable, though. I'm thinking "Use a sugar shard if it can reach maximum efficiency" (i.e. if the amount to heal is greater than the top end of shard healing), but I haven' thought about it too much.

Edit:
I'm reading the special case now.
I've been pretty comfortable with the solution, but if you have a better one I'd be glad to make use of it. How would you decide when to use a moth? Would you wait until you were at least 40 MP down? Note that this would sometimes make it impossible to use moths while building up roc feathers to use when you reach level 4. (And I really need those mp to get those precious feathers.) Or would you want to base your decision to use moths on your maximum MP, so if it is low, then you'll be more permissive about using them. If you've got a solution that I never thought of I'd be overjoyed.
Make a logical check to distinguish on-hand items and items that have to be boughten. Always use Moth before buying. But if the most efficient is an on-hand item, then use Moth instead if it restores at least 2X% of its potential, where 1-X% is the "Autorecover At" percentage.

In Mallmode, always use Moth to recover at least 30MP (you're usually going to be at a level where you have 60, right?). Use on-hand grub with value 3 meat (autosell) which would make it better to autosell it with DrasticCost*100/3 HP (like 30K HP). Also buy grubs if mall prices for it make it efficient, as usual.

Maybe generalize this to be:
cost = mallprice
onHandCost = max(autosell*2,100)< cost? cost: autosell
(i.e. value onhand items as autosell if it's minpriced in the mall)

The thing about using moths is that if you're getting them, you're probably going to be able to use them again later when you have more MP to fill. In other words, if you have gongs now, you will probably have gongs later.

===

Is there something in your script that does manaburning if the setting's on? Like, if manaburning is set to anything but "Do not rebalance", and you're restoring on 100/120 MP, and your most efficient MP restore restores 70-100MP, then manaburn to 50MP before using it. I don't use it, but it would improve efficiency.
 
Last edited:
Could you maybe add an option to use all MP restores in inventory before trying to buy some?
Was this irony because of the "Prefer using inventory instead of mall, regardless of value" option?

In any case, it wasn't exactly what Raijinili was proposing: since an item that is min priced in the mall probably isn't selling, its autosell value should be considered instead.
 
Back
Top