Universal Recovery Script

All those are very good reasons why my script shouldn't have been doing that. Could you check your session log and find out how that got started? thnx.
 
As I said, it had to do with the nuns and my MP burning part of the script. When I fully healed manually, it continued on and used the nuns to burn MP on librams as usual.
 
Medicinal Herb's medicinal herbs don't work with use() any more, chew() should be used instead.

This affects line 1227 (ish? this might be thrown off by my svn edits) which should now be
Code:
return chew(1, $item[Medicinal Herb's medicinal herbs]);
 
Is that still the case? Veracity rolled back the change that required using 'chew' instead of 'use' for spleen items. If mafia isn't working with 'use' then it's probably that one of the mafia flags for it isn't right.
 
Oh I didn't realise it was rolled back for ASH, I thought that was just the CLI command.

use() doesn't work for herbs at the moment, so I'll bugreport. I'd still have thought it'd be best practice to convert use() to chew() for spleen consumables though.
 
Something in my mafia environment is trying to purchase medicinal herbs and failing. The message is
Search complete.
Desired purchase quantity not reached (wanted 1, got 0)
Searching for "Medicinal Herb's medicinal herbs"...

repeated over and over. Herbs are checked as a healing option but there are already 53 in inventory. Character is a Disco Bandit so it could be argued that regardless of the checkbox, herbs should not be considered. It is possible that there is some kind of interaction going related to valuing inventory more or less than other sources. I am running autobasement and it is possible it is the problem, but I saw something similar on a never ascended character during my logout script (which casts clip art if any casts are available and will restore mana as a side effect) and UR is one thing both characters have in common. Thanks.
 
This goes back to the 2162 post, since after Veracity rolled back that change, Darzil re-implemented it. :) This is the line that needs to be tweaked:
Code:
			return use(1, $item[Medicinal Herb's medicinal herbs]);
should be chew.
 
I thought mafia to adapt using spleenies to chew as it does with the CLI command, so I hadn't changed it. Seems I was wrong. I'll change that.

I cannot figure out how it could possibly have used Medicinal Herb's medicinal herbs in a DB run, but I added a check that could possibly fix it anyway.

Hopefully r20 will handle these issues.
 
Well, it initially only had use. And then Veracity made it work with both chew and use. And then Veracity set it to only work with chew. And then she rolled that back and it worked with either one. And then Darzil set it to only work with chew. And that's where we are now. :)

Thanks for the update. Heh.
 
r20 was not working for me with r15605. I reverted to r19, pulled herbs out of the recovery options and things are running. The edge case with the character today is that they are a DB out of ronin with nothing in Hagnks and everything in inventory. On a previous run for reasons unknown to me the character accumulated 40+ Medicinal Herbs. I can try r21 or otherwise provide data tomorrow. Looking at the difference between r20 and r19 I would consider a special case where, if the herbs are on the healing list and in inventory, and spleen is available then they are used. Period. No test for cost, class or level. Of course that creates a special case that needs to be documented..

Much less repeatable but I have also seen the buy 1 and fail behavior on a never ascended Pastamancer. Alas I cannot recall whether that was before, after or during the chew/use changes.

As I write this I also wonder where the spleen capacity is being checked because I know the never ascended character had the issue on logout.

Thanks for trying to deal with this.
 
Update to the above.

r20 and r15630

UR prints
Restoring HP! Currently at 293 of 2464 HP, 363 of 10880 MP, current meat: 477832 ... Target HP = 2464.
and then things stop or hang. Changing the verbosity does not produce any more output for me. Closeting the herbs or taking them off of the list of options allows UR to complete.
 
I'm sure you're already aware of this, as you reported the Doc Galaktik changes, but UR generates the following error and then aborts while attempting a restore:

Code:
Function 'galaktik_cures_discounted( )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (Universal_recovery.ash, line 519)
Autorecovery failed.

This occurs even if I tell UR to not use Doc Galaktik restoratives.
 
Last edited:
Hello~

Possibly (probably?) related to the above post... I am receiving this message in the CLI before each turn:

Code:
Division by zero (Universal_recovery.ash, line 777)

Also, I am receiving a "Between battle actions failed. Click the image if you'd like to continue anyway." message in the relay browser.
 
Hello~

Possibly (probably?) related to the above post... I am receiving this message in the CLI before each turn:

Code:
Division by zero (Universal_recovery.ash, line 777)

Also, I am receiving a "Between battle actions failed. Click the image if you'd like to continue anyway." message in the relay browser.

It actually looks entirely related, since Ailment Ointment doesn't seem to exist anymore. Thanks, revamps.

edit: I guess the item technically exists, but isn't sold anymore. Hm.
 
I took a look at the script to see if there was a quick fix but ran out of time. For now I issued the following command in the gCLI to unset UR as my recovery script:

Code:
set recoveryScript =

Be aware that this will affect both SmartStasis and WHAM.
 
Revision 15765 removed galaktik_cures_discounted(). Presumably because you can use the questM24Doc setting to figure that out yourself.

Seems like keeping backwards compatibility by keeping that function and recoding it to look at the new quest setting, rather than whatever it was looking at before, rather than outright removing it, wouldn't hurt, although I'm all for reducing function bloat; I believe that function was created before we had such robust quest tracking.
 
My thought when removing the function was that any script looking at it would not be getting the result it cared about, so the script would need updating to be useful regardless. I guess it could return a useless false value for now just to not cause scripts to abort?

Besides that, npc_price( item ) updates appropriately for everything there, so I feel like there shouldn't be as much need for that function.
 
A quick fix would be to add something like this to the start of UR and BatBrain.
Code:
boolean galaktik_cures_discounted() {return get_property("questM24Doc")  == "finished";}
 
Back
Top