Universal Recovery Script

Theraze

Active member
Nope, no PVP steals. Think I MIGHT have broken the stone twice in aftercore in something like 700 ascensions. Maybe. But I really don't think there was a second time.
 

xKiv

Active member
Code:
Updating mafiarecovery...
/home/xkiv/.kolmafia/svn/mafiarecovery
U https://svn.code.sf.net/p/mafiarecovery/code/scripts/Universal_recovery.ash
https://svn.code.sf.net/p/mafiarecovery/code/scripts
https://svn.code.sf.net/p/mafiarecovery/code
At revision 12
...
Expected ), found return (Universal_recovery.ash, line 1065)

Sure enough, line 1064 has an "if (get_property(...==...)" which should be "if(get_property(...)==...)".
 
Last edited:

Bale

Minion
Sourceforge is giving me an odd error, "could not begin a transaction" so I can't fix this right now. :(

Thanks for the report and I'll repair it when I can. In the meantime I hope most people can add that closing parenthesis to line 1064.
 

Theraze

Active member
You put the ) in the wrong spot. Look up at 2142 again... you need to put it after the get_property("" instead of at the end and doubling up the parenthesis... If you end up with == "false")) then you did it wrong.
 

xKiv

Active member
You put the ) in the wrong spot. Look up at 2142 again... you need to put it after the get_property("" instead of at the end and doubling up the parenthesis... If you end up with == "false")) then you did it wrong.

I got that wrong the first time too ...
 
Here's a possibly thorny issue, I'm not sure if its come up before in the thread.

I'm wearing the Astral Bracer (-3MP cost to skills in combat). mp_cost($skill[lasagna bandages]) returns 3, but it actually costs 6 outside of combat.
UR has determined that the most efficient HP heal is lasagna bandages, then fails to restore my HP because I don't have enough MP to cast it.

It's a bit of an edge case, and relatively simple to work around, but I thought I should report it.
 

Theraze

Active member
The wrong mp_cost being returned would be a mafia bug... but it's technically correct, and therefore not a bug, as the cost is 3... just not outside combat.

You could make a FReq. Potential requests: default the mp_cost of dual-skills to the out-of-combat cost; default to whichever cost is higher; split in and out of combat prices entirely and have two different functions.

Any of those three could solve this. Unfortunately, for script-writing purposes, there doesn't currently appear to be any easy way to differentiate lasagna bandages (combat and non-combat healing) from saucy salve (combat healing only), for example, without manually parsing the classskills.txt data file...
 
The first two suggestions would just shift the problem elsewhere. The third seems a bit of a sledgehammer to crack a nut.
Code:
> ashq record classskill {skill sk; string image;int type;};classskill [int] classskills;file_to_map("classskills.txt",classskills);foreach k,s in classskills if (s.type==7) print(s.sk);

Lasagna Bandages
Devour Minions
Those are the only two skills affected, and Devour Minions wouldn't be affected by this afaik.

It might just be worth fixing with a special case in UR's mpcost() function. Or ignoring, cause it isn't really a huge deal.
 
My kludge fix was just to add the following in mpcost() after the chilled to the bone clause:
Code:
if(sk==$skill[lasagna bandages]) return max(1,6 - mana_cost_modifier());
 

Bale

Minion
mana_cost_modifier() doesn't include in-combat cost reduction even though mp_cost() includes it? Really? I'll trust you on that.

I'll go and include an adaptation of your fix. Thanks!
 
mana_cost_modifer() returns mana reduction, not including in-combat reduction.
combat_mana_cost_modifer() returns combat mana reduction.

The former definitely doesn't include in-combat cost reduction.
 

Bale

Minion
You taught me something today. My code for mpcost() is now a little more involved than that quick kludge, but it is definitely built around your post.
 

Bale

Minion
I didn't forget that. I was just testing you. Yeah, that's it. You'll be pleased to know that you passed my little test. Congratulations.
 

Cool12309

Member
Very strange behavior. I was running my logout script, came back and saw my CLI spammed with

Code:
Searching for "Medicinal Herb's medicinal herbs"...
Search complete.
Desired purchase quantity not reached (wanted 1, got 0)

Firstly, I do not know why UR was even being called to fully restore HP as it was trying to do nuns for MP.
Secondly, I am surprised UR wanted to use one of my spleen hit points when a drastic healing scroll would be far cheaper.
Thirdly, I do not know why this item was trying to be used regardless of the above, as it is untradeable, I have 0, and you need to be a muscle class with guild access to get one.
 
Top