Universal Recovery Script

Bale

Minion
@Spiny: I'm puzzled but thinking about it.

@Aankhen: That code has not been changed in ages and it worked recently. I cannot explain why it would fail now. Can you try ash use(2, $item[Palm frond]) and let me know if that works? Sadly I did not have any problem with it...

Code:
[COLOR="#808000"]> ash use(2, $item[Palm frond])[/COLOR]

Searching for "palm frond"...
Purchasing palm frond (2 @ 100)...
You acquire palm frond (2)
Purchases complete.
Using 2 palm frond...
You acquire an item: palm-frond fan
Finished using 2 palm frond.
Returned: true

Perhaps mafia's inventory got messed up so it thought that it has 3 palm fronds, but did not. In that case it would fail. Did you try to refresh inventory to see?
 
Last edited:

Aankhen

Member
@Aankhen: That code has not been changed in ages and it worked recently. I cannot explain why it would fail now.
Yeah, I know, that’s why my first guess was a Mafia problem.
Can you try ash use(2, $item[Palm frond]) and let me know if that works? Sadly I did not have any problem with it...
[snip]
Perhaps mafia's inventory got messed up so it thought that it has 3 palm fronds, but did not. In that case it would fail. Did you try to refresh inventory to see?
Unfortunately, my first action after posting was to use the two palm fronds (I had refreshed the inventory multiple times just to be sure they were there) and consume the palm-frond fan so that the script would no longer see it, and as such I can’t confirm. (I haven’t broken the prism either, hence I cannot buy fronds from the mall.)

I guess I’ll have to wait for the problem to show up again and see about reporting it as a Mafia bug.
 

Bale

Minion
Unfortunately, my first action after posting was to use the two palm fronds (I had refreshed the inventory multiple times just to be sure they were there) and consume the palm-frond fan so that the script would no longer see it, and as such I can’t confirm.
Well, that does tell me that you really had those palm fronds in your inventory or else you couldn't have successfully used them. I assume you would have noticed if mafia failed to make the fan.
 

Aankhen

Member
Well, that does tell me that you really had those palm fronds in your inventory or else you couldn't have successfully used them. I assume you would have noticed if mafia failed to make the fan.
Yes, I meant I couldn’t test the ASH line you gave to see if it was just failing in the script.
 

Spiny

Member
Still in the same BM sauce run as previously posted. I was 80/91 hp, but I switched something out to pirate fledges which brought my max hp to 98. I needed mana and I figured I'd do restore both. This time, rather than not heal hp, it used a scroll of drastic healing to heal 18 hp rather than get a couple of ailment ointments. I think these issues come from being in a bad moon run but leaving UR with the setting to buy freely from the mall. Maybe I'm wrong, maybe it's the fact that UR wants to execute a full heal even though the hps I need to heal are trivial.

Code:
> restore both

Calling Universal Recovery for type=HP, amount=98
0 prices updated from http://nixietube.info/mallprices.txt
Pricelist updated.
_meatpermp => 5.0
_meatperhp => 6.6666665
_version_BalesUniversalRecovery => 3.7
Restoring HP! Currently at 80 of 98 HP, 42 of 159 MP, current meat: 30596 ... Target HP = 98.
Trying to fullheal
Using 1 scroll of drastic healing...
Finished using 1 scroll of drastic healing.
Calling Universal Recovery for type=MP, amount=159
Restoring MP! Currently at 98 of 98 HP, 42 of 159 MP, current meat: 30596 ... Target MP = 159.
Try to heal MP from inventory.
Last attempt to purchase MP with meat.
Searching for "magical mystery juice"...
Purchasing magical mystery juice (6 @ 100)...
You acquire magical mystery juice (6)
You spent 600 Meat
Purchases complete.
Using 6 magical mystery juice...
You gain 124 Mana Points
Finished using 6 magical mystery juice.
 

Bale

Minion
Nothing to do with Bad Moon. If can_interact() is false, then it knows not to purchase from the mall. Being in Bad Moon won't change that.

The problem is that it tries to full heal whenever it doesn't have enough smaller heals to do the job. It knew that you didn't have the heals, but you demanded that it heal, so it used the only item it had. I'm afraid that it isn't yet smart enough to figure out the relative values of using the scroll in inventory vs purchasing ailment ointments. It just knows that it is supposed to heal up to 98 HP and doesn't know you have only a few less than that. This is why I hate the CLI restore commands. restore_hp(0) would only have healed hp only if it was below hp restoration target and it wouldn't have used up a scroll meaninglessly...
 

Spiny

Member
Ahhhh ok... the primary reason I explicitly call UR is due to laziness in trying to figure out which/ how many restoratives I need to use to restore to full. In this case, not a good idea, but that's my own fault, but now I know it lol :D
 

Fluxxdog

Active member
Came across a problem.
Code:
Calling Universal Recovery for type=MP, amount=29
Restoring MP! Currently at 34 of 34 HP, 0 of 29 MP, current meat: 4190 ... Target MP = 29.
Try to heal MP from inventory.
Last attempt to purchase MP with meat.
Cannot restore MP because fizzy invigorating tonic is disabled!
Did not fully restore MP for some reason.
Now, I have everything set so that it doesn't restore my MP at all. "Do not auto-recover mana". However, when I get to exactly 0 MP, it tries anyway. My stocking mimic is getting ticked that someone else is trying to do his job! Seriously though, is this supposed to happen?
 

Bale

Minion
Came across a problem.
Code:
Calling Universal Recovery for type=MP, amount=29
Restoring MP! Currently at 34 of 34 HP, 0 of 29 MP, current meat: 4190 ... Target MP = 29.
Try to heal MP from inventory.
Last attempt to purchase MP with meat.
Cannot restore MP because fizzy invigorating tonic is disabled!
Did not fully restore MP for some reason.
Now, I have everything set so that it doesn't restore my MP at all. "Do not auto-recover mana". However, when I get to exactly 0 MP, it tries anyway. My stocking mimic is getting ticked that someone else is trying to do his job! Seriously though, is this supposed to happen?

Yes, it is supposed to happen and has nothing to do with UR. I can see that UR was called with a parameter of 29 rather than 0. (0 means to follow default settings. 29 means that mafia actually wants 29 MP. The second line about restoring MP is where UR is interpreting that parameter converting a 0 into a target if appropriate.) I don't know what the circumstances were, but it is not recovering because Mp is 0. It's recovering because mafia needs 29 MP for some reason. Mafia will restore MP if it needs those MP to cast a buff or something, even when you turn off recovery.

What I find weird about the situation is that you are trying to recover your maximum of 29 MP. What's going on?
 

Fluxxdog

Active member
I'll try it against in the morning. It's just weird though. If I say not to heal MP, it shouldn't try regardless.
 

Bale

Minion
If you say not to heal MP, then it won't... unless you tell it to cast a spell. That's how mafia is. If you want to make it fail, you could add a line at the top of main() saying,

Code:
if((hp_autoheal < 0 && type = "HP") || (mp_autoheal < 0 && type = "MP")) return true;

That will do what you want, but it isn't the behavior mafia expects, so I'm not making that standard.
 
61885698.png

this is not the first time this has happened, but I usually don't notice :(
 

Fluxxdog

Active member
Heh, I think I found the problem. I had my mood set up so if I was low on Disco CONCENTRATION, it would cast Disco Aerobics. Yeah, that shoulod have been Disco STATE OF MIND. Silly me.

Makes sense now, since I never had Concentration, it would keep going for it. Chalk this up to end-user error.
 

slyz

Developer
this is not the first time this has happened, but I usually don't notice :(
If I'm the first to post the bug you were reporting, do I win something?

I'm guessing... UR used your last potion of healing, and you could need it at the gate! Wait, no, you don't need those at the gate... Do I have another guess? I'm guessing... UR restored HP and MP, but your MP settings said to not restore MP! That can't be it either, since that's a feature of UR...

I have no idea, I hope Bale finds the bug report.
 

Bale

Minion
this is not the first time this has happened, but I usually don't notice :(

I can't figure out what the bug is any better than sylz. I know that a picture is supposed to be worth a thousand words, but we need you to use your words. Sorry.


Heh, I think I found the problem. I had my mood set up so if I was low on Disco CONCENTRATION, it would cast Disco Aerobics. Yeah, that shoulod have been Disco STATE OF MIND. Silly me.

Makes sense now, since I never had Concentration, it would keep going for it. Chalk this up to end-user error.

I'm happy you found the problem. :D
 

Spiny

Member
I'm guessing it's the use of the DoD healing potion in forgot my password's report. Once upon a time, I was going to report the same thing and then it dawned on me that it will never be used for the gate so it's cool :)
 

Bale

Minion
You think? I consider the use of DoD healing a very nice feature of my script because I'd NEVER remember to check for that on my own.
 

StDoodle

Minion
How many other ways are there to heal an opponent in HC, though, Bale? Fo' instanz, I often use them against adding machines if I have the scrolls to make both the gates & leet scroll when one shows. Granted, that's the only use that comes to mind, but I don't usually have dozens of extra healing potions, anyway.
 
Top