Universal Recovery Script

Interesting. So, it's because UR uses the 2-parameter version of buy() - which says "buy this many, cost is no object" - rather than the 3-parameter version, in which you specify the price limit - which could/should be get_property( "autoBuyPriceLimit" ).

I think UR does use the 3-parameter version; the issue arises when there are huge discrepancies between historical price and actual price. Or something like that? I'd have to reread or code dive to jog my memory.

Also, if you can use post numbers instead of pages, that would be appreciated... For me, the thread is currently up to page 44. There is no page 166 yet, and likely will never be, unless Bale keeps this thread when 1up bursts forth and the thread keeps its current level of chattiness (or higher) and he maintains 1up for another 8-9 years... :)

Issue starts at post 1657
 
So, it's because UR uses the 2-parameter version of buy()
The script does use the 3 parameter version of buy(). Here is UR's purchase() function:
PHP:
// This will buy an item. The advantage over buy or aquire is that it will check to see if I have q of the item
// in inventory (but not closet) and then buy any extra needed. Returns true if it returns any items at all.
boolean purchase(int q, item it) {
	int price;
	switch(it) {
	case $item[magical mystery juice]:
	case $item[Medicinal Herb medicinal herbs]:
		price = 100;
		break;
	default:
		price = historical_price(it);
	}
	if(buy(q- for_use(it), it, ceil(price*1.25)) > 0 || for_use(it) > 0)
		return true; 	// for_use() needs to be checked both before and after that purchase ;)
	return false;
}
It looks like Mafia updated historical_price($item[green pixel potion]) between the moment UR decided it was a good purchase (for the 3rd time?), and the moment where purchase() was called.

EDIT: ninja'd
 
Universal recovery v 3.9.6 released!



Changelog:
version 3.9.6 June 16, 2012
  • Added Theraze's suggestion to limit by autoBuyPriceLimit just because it's a good idea, but honestly I cannot see how it ever got out of hand like that since every time it hits the maximum price I already implemented with the three-parameter buy() it should recheck to make sure that there isn't a cheaper alternative.
 
Last edited:
I replaced the script with your update and got "Bad effect value: "N-Spatial vision" (Universal_recovery.ash, line 1540)" 3 times when I tried to adventure.
 
This suggests heavily that you need to update mafia to the latest version. Use the daily update from the top of the page, not the month-and-a-half old version from sourceforge, or anything older... especially if you want the brushfire to work properly.
 
I don't know if this is recently occurring or not, but I've noticed today that ur is buying black cherry soda without equipping my trav trousers.
 
You were right, I that preference was unchecked, but after enabling it ur still doesn't equip the pants.
 
Last edited:
I've started getting the following in the last week or so and I'm not sure why. This is with the current Universal Recovery and KOLMafia in Hardcore.

Code:
(usable quantity of magical mystery juice (7) is limited to 6 by needed restoration)
Using 6 magical mystery juice...
You gain 140 Mana Points
Finished using 6 magical mystery juice.
(usable quantity of magical mystery juice is limited to 0 by needed restoration)
Cannot spend meat to fully restore MP! Failed to use magical mystery juice for some reason.
baleUr_MPtrouble => true
Did not fully restore MP for some reason.

I've disabled the automation stop in UR. The puzzling thing is that UR is fully restoring MP when it thinks it hasn't.

Any thoughts? Anything I can do to help figure out what's going on?
 
It's UR underestimating how useful MMJ is, and mafia protecting you from it, because it has a better idea of how much it will actually take to get you fully healed, as you say.

Easiest way to avoid it is to NOT try to fully restore MP... restore to 80% or something like that. But at some point, the MMJ formula probably needs some TLC.
 
So I discovered that the command "sofa 0" will abort with a No Sofa message even if a sofa is present. I'm thinking that perhaps UR should not consider the sofa if it thinks it only needs zero turns or perhaps should bound things below with one turn. It would be interesting to know what changed to make this appear now.
 
It might attempt to use the sofa if it doesn't need to? WTH? That is definitely a bug. Fortunately it is super-easy to fix.


Universal recovery v 3.9.7 released!



Changelog:
version 3.9.7 August 1, 2012
  • Fixed sofa restoration bug.
 
Last edited:
I wasn't too surprised it was using the sofa because the character is pretty poor and my settings are pretty much set so that continuing automation is of more value to me than a turn or three. Probably should go and revisit that :-)
 
Universal recovery v 3.9.8 released!



Changelog:
version 3.9.8 August 16, 2012
  • In Zombiecore: Avoid using Doc Galaktik for healing or purchasing antidotes.
  • In Zombiecore: Will not attempt to restore MP.
  • In Zombiecore: Will Bite Minion to regain 10 HP.


This was just the basic Zombie Slaying upgrade. Honestly it is kinda patchwork and there are several things wrong with it. In addition to fixing that I need to add the following features:
  • I have no good information about Devour Minions so I cannot add that yet.
  • When I have time I need to add the ability to use Summon Minion and Summon Horde to gain horde for you to gobble for HP.

This reminds me that I really need to find time to work on 1Up.
 
Last edited:
Devour Minions seems to heal 50% of your max HP for 4 minions. More efficient than 5x bite minion. I removed tetanus with Bite Minion after getting the Devour Minions upgrade too, so the negative effects removal seems to work too.
 
If you have a dwelling higher than newbie-tent and have not yet acquired summon minion I think it is more efficient to rest at your campsite than to sacrifice a minion (since both costs an adventure in the end), at least until you get rather high HP.
 
Back
Top