Recovery Script for Hardcore

Status
Not open for further replies.

asturia

Minion
What I normally do is to use cocoon when the price of a healing item for hp is more then an item to regenerate the mp used by the cocoon.

I hope this was enough information?
 

Bale

Minion
[quote author=asturia link=topic=2029.msg10719#msg10719 date=1230304994]
What I normally do is to use cocoon when the price of a healing item for hp is more then an item to regenerate the mp used by the cocoon.

I hope this was enough information?
[/quote]

I suppose I could figure that out.
 
Hep me! Here is what I have going on. I have a disco bandit in ronin, and I buy 2 soda waters every turn. I never use them, I just buy them. Every turn. Until I run out of meat. Then I get an error that says I am still in ronin. I assume that I am then trying to buy soda water in the mall.

The script runs perfectly fine with my other characters, including one in BM.

Any ideas? What can I do to help get this figured out?

PS, the script is way cool. I am not a programmer, so I can only imagine the effort that goes into mafia and the other scripts. Thanks to all of you!

Edit - Running windows XP, sp3, current java engine.
 

Bale

Minion
[quote author=siameseretriever link=topic=2029.msg10744#msg10744 date=1230435896]
Hep me! Here is what I have going on. I have a disco bandit in ronin, and I buy 2 soda waters every turn. I never use them, I just buy them. Every turn. Until I run out of meat. Then I get an error that says I am still in ronin. I assume that I am then trying to buy soda water in the mall.
[/quote]

I want to help you, very much. I find this extremely puzzling, so I'm going to ask you a couple of questions to help me narrow down the problem.

1. Please tell me which version of the script you are using. At the top of the script are a lot of lines of text describing the program and what it does. One of the bottom lines should tell you which version it is just to make sure. Hopefully you're using version 1.4

2. What build (or version) of KolMafia are you using?

3. You say that it purchases 2 soda waters every turn. Does it purchase them 1 at a time, or both together? Also, please confirm: Does mafia show that you have a large pile of soda water after this has happened?

4. This is important! Copy and paste all the text that appears in the CLI between battles when it should be healing. I want to know what my script is telling you and all other output in the CLI. It would help me a lot. Just highlight all those lines and use ctrl-C to copy.

Thank you. I really hope to fix this.
 
[quote author=Bale link=topic=2029.msg10746#msg10746 date=1230446066]
I want to help you, very much. I find this extremely puzzling, so I'm going to ask you a couple of questions to help me narrow down the problem.

1. Please tell me which version of the script you are using. At the top of the script are a lot of lines of text describing the program and what it does. One of the bottom lines should tell you which version it is just to make sure. Hopefully you're using version 1.4

2. What build (or version) of KolMafia are you using?

3. You say that it purchases 2 soda waters every turn. Does it purchase them 1 at a time, or both together? Also, please confirm: Does mafia show that you have a large pile of soda water after this has happened?

4. This is important! Copy and paste all the text that appears in the CLI between battles when it should be healing. I want to know what my script is telling you and all other output in the CLI. It would help me a lot. Just highlight all those lines and use ctrl-C to copy.

Thank you. I really hope to fix this.
[/quote]

More to come. Version 1.4 of the script, 12.7 of mafia, it purchases them separately, and I ended up with 900+ soda waters so far. Copy coming up soon. I should have been in bed a lone time ago!
 
Here is my c&p...

set recoveryScript = hardcore_recoveryScript

recoveryScript => hardcore_recoveryScript
Validating adventure sequence...
Condition added: oily rag (4)
Requests complete.

Attempting to autoheal HP with Bale's hardcore recoveryScript.
Searching for "soda water"...
Purchasing soda water (1 @ 70)...
You acquire an item: soda water
Purchases complete.
AutoHeal if at 33HP, up to -> 55HP.
HP has been healed up to default levels. My work here is done.
Attempting to autoheal MP with Bale's hardcore recoveryScript.
Searching for "soda water"...
Purchasing soda water (1 @ 70)...
You acquire an item: soda water
Purchases complete.
AutoHeal if at 13MP, up to -> 50MP.
MP has been healed up to default levels. My work here is done.

Request 1 of 25 (Plains: Degrassi Knoll) in progress...

[821] Degrassi Knoll
Encounter: Gnollish Tirejuggler
Strategy: attack with weapon
Round 0: yubble dum wins initiative!
Round 1: yubble dum tries to steal an item!
You acquire an item: tires
Round 2: yubble dum attacks!
You gain 60 Meat
You gain 4 Roguishness

Attempting to autoheal HP with Bale's hardcore recoveryScript.
Searching for "soda water"...
Purchasing soda water (1 @ 70)...
You acquire an item: soda water
Purchases complete.
AutoHeal if at 33HP, up to -> 55HP.
HP has been healed up to default levels. My work here is done.
Attempting to autoheal MP with Bale's hardcore recoveryScript.
Searching for "soda water"...
Purchasing soda water (1 @ 70)...
You acquire an item: soda water
Purchases complete.
AutoHeal if at 13MP, up to -> 50MP.
MP has been healed up to default levels. My work here is done.

Request 2 of 25 (Plains: Degrassi Knoll) in progress...

[822] Degrassi Knoll
Encounter: Gnollish Crossdresser
Strategy: attack with weapon
Round 0: yubble dum wins initiative!
Round 1: yubble dum tries to steal an item!
Round 2: yubble dum attacks!
You gain 57 Meat
You gain 4 Enchantedness

Attempting to autoheal HP with Bale's hardcore recoveryScript.
Searching for "soda water"...
Purchasing soda water (1 @ 70)...
You acquire an item: soda water
Purchases complete.
AutoHeal if at 33HP, up to -> 55HP.
HP has been healed up to default levels. My work here is done.
Attempting to autoheal MP with Bale's hardcore recoveryScript.
Searching for "soda water"...
KoLmafia declares world peace.

Attempting to autoheal HP with Bale's hardcore recoveryScript.
Searching for "soda water"...
Purchasing soda water (1 @ 70)...
You acquire an item: soda water
Purchases complete.
AutoHeal if at 33HP, up to -> 55HP.
HP has been healed up to default levels. My work here is done.

And when I run out of meat:

Attempting to autoheal HP with Bale's hardcore recoveryScript.
Searching for "soda water"...
Purchasing soda water (1 @ 70)...
You acquire an item: soda water
Purchases complete.
AutoHeal if at 33HP, up to -> 55HP.
HP has been healed up to default levels. My work here is done.
Attempting to autoheal MP with Bale's hardcore recoveryScript.
You are not yet out of ronin.

Attempting to autoheal HP with Bale's hardcore recoveryScript.
You are not yet out of ronin.
 

Bale

Minion
Thank you. That copy/paste was very helpful. I believe I've fixed the bug and released version 1.5 just for you, so we'll call this the siameseretriever release. :D

Please download the new version and let me know if it fixes the problem. I'm pretty certain that it'll be good now.
 
[quote author=Bale link=topic=2029.msg10750#msg10750 date=1230451078]
Thank you. That copy/paste was very helpful. I believe I've fixed the bug and released version 1.5 just for you, so we'll call this the siameseretriever release. :D

[/quote]

Usually the SiameseRetriever release means a trip to the doctor's office and a shot. This is a nice change! I am out of ronin now, but I am trying this now.
 

ironsting

Member
Love your script and only have one question/problem. It doesn't appear to be grabbing the HP/MP settings from the mafia HP/MP usage tab. This is from the hardcore_recoveryScript.ash in my script folder:

record restorative_info { // Used for storing restorative data.
int minhp;
int maxhp;
int minmp;
int maxmp;
boolean combat;
};

restorative_info [item] heal; // This is the map of all restoratives and how much they heal.

// These are the default values to restore hp and mp.
int hp_autoheal = ceil(my_maxhp() * to_float(get_property("hpAutoRecovery")));
int hp_autotarget = ceil(my_maxhp() * to_float(get_property("hpAutoRecoveryTarget")));
int mp_autoheal = ceil(my_maxmp() * to_float(get_property("mpAutoRecovery")));
int mp_autotarget = ceil(my_maxmp() * to_float(get_property("mpAutoRecoveryTarget")));

int objective; // This is the target passed to the recoveryScript.

If I understand correctly it should be grabbing data and have values but there are none there which gives me:

Attempting to heal up to 155HP with Bale's hardcore recoveryScript.
Current HP: 154, Current MP: 68... restoring HP! Target = 155
Casting Lasagna Bandages 1 times...
You gain 10 hit points
Lasagna Bandages was successfully cast.
HP is 155 or greater. My work here is done.
Attempting to heal up to 63MP with Bale's hardcore recoveryScript.
Current HP: 164, Current MP: 62... restoring MP! Target = 63
Searching for "magical mystery juice"...
Purchasing magical mystery juice (1 @ 100)...
You acquire an item: magical mystery juice
Purchases complete.
Using 1 magical mystery juice...
You gain 22 Mana Points
Finished using 1 magical mystery juice.
MP is 63 or greater. My work here is done.
Attempting to heal up to 165HP with Bale's hardcore recoveryScript.
Current HP: 164, Current MP: 84... restoring HP! Target = 165
Casting Lasagna Bandages 1 times...
You gain 28 hit points
Lasagna Bandages was successfully cast.
HP is 165 or greater. My work here is done.
Attempting to heal up to 79MP with Bale's hardcore recoveryScript.
Current HP: 192, Current MP: 78... restoring MP! Target = 79
Searching for "magical mystery juice"...
Purchasing magical mystery juice (1 @ 100)...
You acquire an item: magical mystery juice
Purchases complete.
Using 1 magical mystery juice...
You gain 22 Mana Points
Finished using 1 magical mystery juice.
MP is 79 or greater. My work here is done.

Current max HP is 210 and MP is 384. The Usage is set to 95%. Any ideas why it isn't healing or filling MP to the level I set?

Thanks again for all your hard work.
 

Bale

Minion
[quote author=ironsting link=topic=2029.msg10787#msg10787 date=1230598933]
Current max HP is 210 and MP is 384. The Usage is set to 95%. Any ideas why it isn't healing or filling MP to the level I set?

Thanks again for all your hard work.
[/quote]
Yes, I can answer you question and the problem is with mafia. My script can be called in two modes. It can be called to autoheal or it can be called to heal up to a specific quantity. Unfortunately you were calling my script in the later mode. (The output is very clear about this.)

If I was going to guess, I suspect you were clicking on your Hp or Mp to invoke healing. For some reason when you do that, instead of calling my script to heal up to your autoheal settings, it attempt to heal up to 1 Mp or Hp more than you currently possess. I have no idea why KolMafia does that and reported it once as a bug, though nothing changed. I suspect I ought to report that again.

[quote author=asturia link=topic=2029.msg10719#msg10719 date=1230304994]
What I normally do is to use cocoon when the price of a healing item for hp is more then an item to regenerate the mp used by the cocoon.

I hope this was enough information?
[/quote]
I've been thinking a lot about that answer. My response is slowly being conceived. Unfortunately this idea works on a completely different paradigm than my current script so I'm having to work on a complete rewrite. The good news is that when (if?) I finish, I'm going to have a healing script optimized for farming that keeps track of the mall prices for all healing items to figure out what to purchase. It is bitchy dealing with not having a script to consult the mall, but fortunately there are some wonderful examples on this forum of how to work around the problem and I'm borrowing liberally from the example of zarqon and dj_d.
 

ironsting

Member
Thanks for the reply. For now I will make a hotkey "set recoveryScript = hardcore_recoveryScript" and "set recoveryScript =" and see how that works.
 

Bale

Minion
Not to worry with that work-around. Jason just fixed the problem for us and now it should work the way you expected. This is part of the changelog on today's build:

[quote author=dangerpin link=topic=2119.msg10806#msg10806 date=1230696992]
Revision: 6698
Author: jasonharper
Date: 10:06:50 AM, Tuesday, December 30, 2008
Message:
"recover" command now recovers up to your autorecovery target if the current
value is below it, and only then recovers one point at a time. This makes no
difference with the built-in recovery mechanism, which has a special case
that accomplishes the same thing, but makes a lot more sense with a
recoveryScript.

The HP & MP values in the relay browser are now clickable if they're less
than the maximum, rather than the autorecovery target. This makes it easier
to recover a bit more when needed; healing up for a boss fight, or making
sure that you'll be able to cast Olfaction, for example.
----
Modified : /src/net/sourceforge/kolmafia/KoLmafiaCLI.java
Modified : /src/net/sourceforge/kolmafia/webui/CharPaneDecorator.java
[/quote]

Ain't it awesome how responsive the kolMafia developers can be?
 

kain

Member
so I've used this script exclusively for recovery post-prism/ronin ... for about a week now.

My only complaint/comment is that it prefers to BUY ancient magi-wipes/monstar energy beverage if I have available meat as opposed to using the ones I have in inventory already. If I closet my meat, it will happily use items those items that I have in inventory.

HP regen rocks (but then again, I have all the skills soft-perm'd, so that's inconsequential)
 

Bale

Minion
[quote author=kain link=topic=2029.msg10981#msg10981 date=1231512528]
so I've used this script exclusively for recovery post-prism/ronin ... for about a week now.

My only complaint/comment is that it prefers to BUY ancient magi-wipes/monstar energy beverage if I have available meat as opposed to using the ones I have in inventory already. If I closet my meat, it will happily use items those items that I have in inventory.
[/quote]

It really should not do that. I'll have to look into the problem. Thanks.
 

ironsting

Member
Not sure what happened here. I was playing in the relay browser and Mafia was using tongue etc but it didn't reflect in the relay browser so I hit the "0" link in the HP and got this.

[2004] Sorceress' Hedge Maze
Encounter: topiary golem
Round 0: ironsting loses initiative!
You lose 42 hit points
Round 1: ironsting casts LUNGING THRUST-SMACK!
You lose 40 hit points
Round 2: ironsting casts SAUCEGEYSER!
Round 2: topiary golem takes 103 damage.
You lose 42 hit points
Attempting to autoheal HP with Bale's hardcore recoveryScript.
AutoHeal if at 88HP, up to -> 112HP.
Current HP: 0, Current MP: 259... restoring HP! Target = 112
You've had the crap beaten out of you... attempting to find some more crap.
Casting Tongue of the Walrus 1 times...
You gain 34 hit points
Tongue of the Walrus was successfully cast.
Casting Cannelloni Cocoon 1 times...
You gain 99 hit points
Cannelloni Cocoon was successfully cast.
HP has been healed up to default levels. My work here is done.
Attempting to autoheal MP with Bale's hardcore recoveryScript.
AutoHeal if at 224MP, up to -> 426MP.
MP has been healed up to default levels. My work here is done.

> restore hp

Attempting to heal up to 134HP with Bale's hardcore recoveryScript.
Current HP: 133, Current MP: 229... restoring HP! Target = 134
Casting Lasagna Bandages 1 times...
You gain 27 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 12 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 11 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 11 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 18 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 20 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 30 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 25 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 29 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 22 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 30 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 11 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 22 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 22 hit points
Lasagna Bandages was successfully cast.
Casting Lasagna Bandages 1 times...
You gain 29 hit points
Lasagna Bandages was successfully cast.
KoLmafia declares world peace.
 

StormCrow42

Member
First off, just want to say what a wonderful script this is.

Second, I experienced the looping lasagna bandages problem when Mafia kept switching on my Brimstone Bracelet to cast it and then taking it back off to restore my previous outfit afterwards.
 

Bale

Minion
[quote author=StormCrow42 link=topic=2029.msg11056#msg11056 date=1231884183]
First off, just want to say what a wonderful script this is.[/quote]
Thanks!

Second, I experienced the looping lasagna bandages problem when Mafia kept switching on my Brimstone Bracelet to cast it and then taking it back off to restore my previous outfit afterwards.
Lately I've been killing a couple of bugs, but that one is gonna be a bit harder to deal well with... I'll think about it. Right now all I can think of is detecting if you're caught in a loop and aborting out of it before you cast bandages too many times. XD
 

jabberw0ck

New member
Let me say again that using this script has been an absolute joy. I frequently lose track of my HP and MP and often only realize I'm out of MP when KOL refuses to cast something...so it is nice to have something in the background that will efficiently help me out.

I'm having the following problem and it is occurring in both HCO and a regular run. I'll just cut and paste what I see:

Attempting to autoheal HP with Bale's hardcore recoveryScript.
AutoHeal if at 183HP, up to -> 261HP.
HP has been healed up to default levels. My work here is done.
Attempting to autoheal MP with Bale's hardcore recoveryScript.
AutoHeal if at 42MP, up to -> 105MP.
Current HP: 233, Current MP: 27... restoring MP! Target = 105
Searching for "black cherry soda"...
Purchasing black cherry soda (7 @ 80)...
You acquire black cherry soda (7)
Purchases complete.
Using 7 black cherry soda...
You gain 67 Muscularity Points
Finished using 7 black cherry soda.
Searching for "black cherry soda"...
Purchasing black cherry soda (1 @ 80)...
You acquire an item: black cherry soda
Purchases complete.
Using 1 black cherry soda...
You gain 9 Muscularity Points
Finished using 1 black cherry soda.
Insufficient meat to fully restore MP without wasting restoratives.
Retrieving character data...
Requests complete.

When I get "Insufficient meat to fully restore MP without wasting restoratives.", mafia simply stops at that point and I have to manually click "begin" again to continue adventuring. Any ideas why this is happening? I shouldn't be because of an actualy lack of meat because I have plenty both on me and in my closet.
 

Bale

Minion
[quote author=jabberw0ck link=topic=2029.msg11074#msg11074 date=1231940651]
When I get "Insufficient meat to fully restore MP without wasting restoratives.", mafia simply stops at that point and I have to manually click "begin" again to continue adventuring. Any ideas why this is happening? I shouldn't be because of an actualy lack of meat because I have plenty both on me and in my closet.
[/quote]

I understand the problem. It's because of an assumption that I made early on and never corrected. I'll fix this in the next update. My next version (including a fix for this foolishness) will be released in a day or two.
 
Status
Not open for further replies.
Top