Universal Recovery Script

fronobulax, thank you for a compliment... I think.
It's supposed to be a compliment. Maybe I need to continue my English as a First Language courses?

I understand why mafia resets the setting but I've never found it to be much of an advantage for my play style. It seems to me that there is a logical inconsistency to having UR enabled and having all thresholds set to DON'T, but I don't really know where I would suggest change be made.
 
I understand why mafia resets the setting but I've never found it to be much of an advantage for my play style. It seems to me that there is a logical inconsistency to having UR enabled and having all thresholds set to DON'T, but I don't really know where I would suggest change be made.

I don't see a logical inconsistency. It makes sense that at level 1 your resources are nearly non-existent and you'd want to restrict automatic recovery, even if you have UR. Of course that doesn't apply much to the play styles of experienced players whose characters have useful healing skills and important combat skills, like you and I. That is why you should put it in your postAscensionScript like I do. Take a look at newLife and copy over the parts you like. Then you'll never have that problem again.
 
Whoops. Different inconsistency.

I have a setting in place A that effectively says I think I can successfully adventure in in a location as long as my current HP is x% or greater.

I have a setting in place B that effectively says that I should always recover my HP so that I have at least y%.

If y >= x then I should never have problems because I will never try and adventure in a situation I have deemed unsafe. The fact that A and B don't know about each other and "coordinate" on setting x and y is the inconsistency I noted.

In this case A is a combination of settings used in Ascend (and I presume there is something similar embedded in BCC's script although I don;t have enough experience to confirm that) and B is UR. When y is effectively zero sooner or later Ascend unwittingly does something unsafe.
 
Are you saying that Ascend only sets x and not y? That sounds like an Ascend bug. UR will follow whatever values for x and y are set by other programs. It doesn't need to know anything about how those values are set to obey them. Or maybe I still have no idea what you're talking about.
 
Are you saying that Ascend only sets x and not y? That sounds like an Ascend bug. UR will follow whatever values for x and y are set by other programs. It doesn't need to know anything about how those values are set to obey them. Or maybe I still have no idea what you're talking about.

Yep. You are correct. At present Ascend does not set y for UR and one could argue that it should not because doing so would create a dependency on UR that currently does not exist. (Using UR is a highly recommended option but not a requirement). My solution in cases like this is usually to create some kind of global or meta setting and try and convince everyone concerned that playing nicely together means using that setting.

I suppose I should have made it clear, especially since I was hijacking the UR thread, that in no way did I consider this particular "x, y" problem UR's to solve. I was just musing on a more general situation that happened to come to my attention because of UR. I also doubt that we would ever get close to my ideal as long as there are scripters who use KoLmafia preferences and not zLib variables (and visa versa) and no clear understanding of when to use one rather than the other for objective, technical, reasons.
 
Well, as a solution, programs like Ascend could check the value of recoveryScript and assume that if it is not blank, then it must be doing something helpful enough to be worth setting the recovery target.
 
I'm having issues with the script using all my meat on Doc Galactik's Ailment Ointments even though that option was disabled in the relay UI. Also, it will not attempt to rest at dwelling as a last resort, instead it just tells me that I don't have enough money to restore my health.
 
Last edited:
From looking at the code, UR doesn't seem to actually check the setting for Doc Galactik's Ailment Ointments. It uses them whenever they are cheaper than Galaktik's Curative Nostrum (although I'm not sure about this), or if you have Galaktik's Curative Nostrum turned off (which is the case for you).

Regarding the campground, UR will only spend an adventure resting if both the HP and the MP you will gain from resting won't be lost (i.e. if resting would restore your HP/MP to more than your max). Is that the case for you?
 
Last edited:
For some reason it's trying to buy a six pack of new cloaca cola to restore my MP. Since they're apparently going for 35K mafia can't buy it and it's looping instead of trying to buy something cheaper.
 
For some reason it's trying to buy a six pack of new cloaca cola to restore my MP. Since they're apparently going for 35K mafia can't buy it and it's looping instead of trying to buy something cheaper.

Strange. I'd be acquiring those with buy() which ignores autoBuyPriceLimit, but the final parameter restricts the price to 125% of what I was expecting, so if the purchase fails, it will be automatically be repriced correctly.

That should prevent the loop. Could you turn up the verbosity with

Code:
set baleUr_Verbosity = 2

That way if the problem repeats I'd be able to see where the bug might be.
 
Strange. I'd be acquiring those with buy() which ignores autoBuyPriceLimit, but the final parameter restricts the price to 125% of what I was expecting, so if the purchase fails, it will be automatically be repriced correctly.

That should prevent the loop. Could you turn up the verbosity with

Code:
set baleUr_Verbosity = 2

That way if the problem repeats I'd be able to see where the bug might be.

With verbosity at 2:

Code:
Restoring MP! Currently at 752 of 752 HP, 217 of 445 MP, current meat: 278805 ... Target MP = 445.
In mallmode, best MP restorative is: New Cloaca-Cola @ 1.52 meat total.
Trying to use 1 New Cloaca-Cola
Refreshing stash contents...
Stash list retrieved.
Searching for "six-pack of new cloaca-cola"...
Search complete.
Stopped purchasing six-pack of New Cloaca-Cola @ 35,000.
Using cached search results for six-pack of New Cloaca-Cola...
Stopped purchasing six-pack of New Cloaca-Cola @ 35,000.
You need 1 more six-pack of New Cloaca-Cola to continue.
Failed to use an item from the mall.
Current HP: 752, MP: 217
In mallmode, best MP restorative is: New Cloaca-Cola @ 1.52 meat total.

And it keeps looping until I hit escape.

Edit: And I just manually purchased the six pack and tried to restore my MP again to see what it would do. It consumed all six even though it should have needed three at most (and even that would have been overkill).

Code:
Restoring MP! Currently at 752 of 752 HP, 217 of 445 MP, current meat: 243805 ... Target MP = 445.
In mallmode, best MP restorative is: six-pack of New Cloaca-Cola @ 0.25333333 meat total.
_meatpermp => 0.0011111111
Trying to use 1 six-pack of New Cloaca-Cola
Using 1 six-pack of New Cloaca-Cola...
You acquire New Cloaca-Cola (6)
Finished using 1 six-pack of New Cloaca-Cola.
Using 6 New Cloaca-Cola...
You gain 921 Muscularity Points
Finished using 6 New Cloaca-Cola.
Current HP: 752, MP: 445

Closeted all but 5000 meat, we'll see if it's a bit more frugal when I don't have a huge wad on hand.
 
Last edited:
I think I may have found a clue to the problem, if you can answer yes to the following question. Do you have mafia set to take items from the clan stash whenever needed and do you hop clans from time-to-time?

The second bug, when you bought a six-pack was an entirely different different bug that I need to fix, but it has nothing at all to do with the first problem. Curiously you found two issues.
 
Last edited:
I think I may have found a clue to the problem, if you can answer yes to the following question. Do you have mafia set to take items from the clan stash whenever needed and do you hop clans from time-to-time?

The second bug, when you bought a six-pack was an entirely different different bug that I need to fix, but it has nothing at all to do with the first problem. Curiously you found two issues.

I have it set pull from stash currently, but I don't think I've clan hopped in months. I also just noticed it deciding to use 23 tiny houses instead of using a scroll of drastic healing. That may be related to it drinking an entire six pack though. I'll shut off pull from stash for now and see if anything changes.
 
What karma privileges do you have for clan stash? Do you have six packs in the stash and could you have gotten it?

I also just noticed it deciding to use 23 tiny houses instead of using a scroll of drastic healing. That may be related to it drinking an entire six pack though. I'll shut off pull from stash for now and see if anything changes.

That would not be related. It is also very odd, so I'd like to see the verbose CLI of anything like that.

I'm attaching a version of my script that deals with the over-use of new coke, but not any other problem.
 

Attachments

Thanks for the updated script. I'm exempt from karma requirements in my clan, but there was no new cloaca-cola in the stash for it to get. Unfortunately the part where it over used the houses scrolled off the top of my CLI, but I noticed it stopped over using them when I manually purchased some scrolls of drastic healing. It is however still purchasing them in groups of 23.
 
Unfortunately the part where it over used the houses scrolled off the top of my CLI, but I noticed it stopped over using them when I manually purchased some scrolls of drastic healing. It is however still purchasing them in groups of 23.

Oh. Purchased them in groups of 23. Not used them. That's not a bug, that's a KoLmafia feature that my script cannot avoid. Frequently purchased (and inexpensive) items like tiny houses, SGEEAs or antidotes will always be purchased with a minimum quantity of 23 to reduce hits. That isn't my script's fault and I approve of that feature, so I wouldn't want to stop it even if I could.

Now for a question: Do you have my script set to "Prefer using inventory instead of mall, regardless of value". in the CLI type
Code:
[COLOR="#808000"]> get baleUr_UseInventoryInMallmode[/COLOR]
That could explain why it might like to use 23 tiny houses at once... Ouch. It wouldn't be a bug though, that'd be operating perfectly though it would be a good reason for me to remove that "feature".
 
Oh. Purchased them in groups of 23. Not used them. That's not a bug, that's a KoLmafia feature that my script cannot avoid. Frequently purchased (and inexpensive) items like tiny houses, SGEEAs or antidotes will always be purchased with a minimum quantity of 23 to reduce hits. That isn't my script's fault and I approve of that feature, so I wouldn't want to stop it even if I could.

Sorry for the confusion. Prior to me buying scrolls of drastic healing manually it did use 23 houses in one go.

Now for a question: Do you have my script set to "Prefer using inventory instead of mall, regardless of value". in the CLI type
Code:
[COLOR="#808000"]> get baleUr_UseInventoryInMallmode[/COLOR]
That could explain why it might like to use 23 tiny houses at once... Ouch. It wouldn't be a bug though, that'd be operating perfectly though it would be a good reason for me to remove that "feature".

Yes I did. I think I was misreading it as similar to the eatdrink.ash option that tells that script to go ahead and eat/drink/spleen expensive items that are sitting in your inventory even if it wouldn't consider buying them (I like to choose that option so I actually use items purchased in AR's). I've deselected that and hopefully won't have any more trouble with it preferring about 5000 meat of houses to about 800 meat of scrolls.
 
Back
Top