loathers / autoscend

An ascension script for KoLMafia
Other
45 stars 67 forks source link

plumber error before fighting shadow #256

Closed taltamir closed 4 years ago

taltamir commented 4 years ago

Context

Current Behavior

autoscend quit with an error saying I only have 4 healing items to fight the shadow and its not sure if its enough. I had over 5000 coins which is enough to buy 250+ more super deluxe mushrooms.

It did correctly count my super deluxe mushrooms. (I had 12 normal healing items like filthy poultice and gauze garter, but plumbers only use mushrooms). And it looks like it actually bought 3 super deluxe mushrooms beforehand. So I think the error is that it is aiming to purchase 4 but then aborting with the complaint we only have four? raise it to acquire 5 instead?

Failure Information (for bugs)

[715] Tower Level 4
Encounter: The Mirror in the Tower has the View that is True
[INFO] - Turn(714): Starting with 92 left and 8 pulls left at Level: 14
[INFO] - Encounter: -15.0 Exp Bonus: 10.55
[INFO] - Meat Drop: 170.0 Item Drop: 179.08099243547832
[INFO] - HP: 438/438, MP: 427/427
[INFO] - Tummy: 25/25 Liver: 0/0 Spleen: 0/5
[INFO] - ML: 0 control: 0
[INFO] - Delay between adventures... beep boop... 
Countdown: 1 second...
Waiting completed.
[WARNING] - Had overdue sausage but couldn't find a zone to burn delay
[INFO] - Scaling the mighty NStower...
[INFO] - Post Adventure done, beep.
Verifying ingredients for super deluxe mushroom (3)...
Purchasing super deluxe mushroom (3 @ 20 coins)...
Visiting the Mushroom District Item Shop...
You acquire super deluxe mushroom (3)
Mushroom District Item Shop successfully looted!
Successfully created super deluxe mushroom (3)
We only have 4healing items, I'm not sure we can do the shadow.
Stack trace:
  at L13_towerNSTower (auto_tower.ash:923)
  at doTasks (autoscend.ash:6118)
  at auto_begin (autoscend.ash:6261)
  at safe_preference_reset_wrapper (autoscend.ash:6330)
  at safe_preference_reset_wrapper (autoscend.ash:6337)
  at safe_preference_reset_wrapper (autoscend.ash:6337)
  at safe_preference_reset_wrapper (autoscend.ash:6337)
  at main (autoscend.ash:6365)
jeparo commented 4 years ago
        int n_healing_items = item_amount($item[gauze garter]) + item_amount($item[filthy poultice]);
        if(in_zelda())
        {
            n_healing_items = item_amount($item[super deluxe mushroom]);
            if(n_healing_items < 5)
            {
                retrieve_item(5 - n_healing_items, $item[super deluxe mushroom]);
                n_healing_items = item_amount($item[super deluxe mushroom]);
            }
        }
        if(n_healing_items < 5)
        {
            abort("We only have " + n_healing_items + "healing items, I'm not sure we can do the shadow.");
        }

I'm not sure what's going on here, the code looks fine.

taltamir commented 4 years ago

Yea, this is weird. Because as you said the code looks fine

jeparo commented 4 years ago

Oh, retrieve_item(n, it) doesn't get n of the item, it gets up to n. So the subtraction is dumb, should be 5. I'll fix it.

taltamir commented 4 years ago

fixed by #257