Bug - Fixed Inventory bug

Grotfang

Developer
Also on 8826 (with 52 salts in inventory):

> autosell 11 fancy bath salts

Autoselling items to NPCs...
You gain 3,300 Meat
Items sold.

I'm not able to reproduce this. Could you give more info? How many salts did you have, for example? I tried this with both 12 in inventory and more and couldn't get your result in either instance. Anything else you can think of that might be relevant?
 
I had exactly 12 in my inventory; and mafia autosold all of them.

Here is a part of my today's raw log:

[605] Haunted Bathroom
Encounter: claw-foot bathtub
Round 0: nightbird wins initiative!
Round 0: nightbird casts CANNELLONI CANNON! (auto-attack)
Round 2: claw-foot bathtub takes 107 damage.
You lose 17 hit points
Adjusted combat item count: gob of wet hair
Round 2: nightbird executes a macro!
Round 2: nightbird casts CANNELLONI CANNON!
Round 3: claw-foot bathtub takes 109 damage.
You acquire an item: fancy bath salts
After Battle: Cthulhu leans against a cactus, produces a bottle of tequila, and drinks it. A few minutes later, he belches some murky fluid back into the bottle and hands it to you.
You acquire an item: agua de vida
You gain 6 Fortitude
You gain 15 Enchantedness
You gain 7 Roguishness
Adjusted combat item count: fancy bath salts (-1)

buy 1 forged identification documents at market price from Black Market

buy 1 can of black paint at market price from Black Market
You acquire an item: can of black paint
You spent 1,000 Meat

autosell: 11 fancy bath salts
You gain 3,600 Meat


autosell: 12 twinkly nuggets
You gain 720 Meat

autosell: 2 procrastination potion
You gain 276 Meat
 
Last edited:

Veracity

Developer
Staff member
This is not an autosell bug. This is an inventory quantity bug. You identified it right there in your transcript.

When you ask KoLmafia to autosell things, it groups the items to be sold into "selling all of them" vs. "selling 6 of them" and "selling 8 of them" and so on and submits the correct options to KoL to sell each group as a whole. One of the options is "sell all". Apparently it believed that you had 11 bath salts, so selling 11 was "selling all", and it told KoL to do that.

Unfortunately, you really had 12 in your inventory.

As I said, this is an inventory quantity bug, not an autosell bug.
 

xKiv

Active member
Does mafia issue a request to autosell "all of" when it thinks that's what is happening?
(to save server hits when you do something like "autosell A B, C D, E F" when you have exactly A of item B, exactly C of item D and exactly E of item F).

(ETA: ^^^^ this was ninja'd by Veracity
vvvv but this wasn't)

This looks like
1) you had 11 before the battle
2) on the last round, mafia saw 11 fancy bath salts in your combat items, and set to remember that
3) you got extra fancy bath salts from the item drop, mafia adjusted inventory count (correctly) to 12
4) *now* mafia finally got to the adjustment from 2), setting your inventory count of FBS to 11 (adjusted count by -1)
5) you effectively told mafia to autosell all of your FBS
6) so mafia autosold all your FBS

I have no idea what would cause the order of adjustments to be like that, but that off-by-one has been reported several times, and I don't think it ever got fixed.
 
Thanks. At least now I know what exactly happened and I'll do "refresh inventory" before autoselling anything with mafia in speedruns (while this bug is still not fixed) :)
 

xKiv

Active member
Aaand ... I just looked it up in the code.
for a fight, GenericResponse first parses the text of the page for things that happen in combat, including acquired items (processResponse() calls FightRequest.updateCombatData() which calls FightRequest.processNormalResults() which calls FightRequest.processNode() which does that "You acquire an item").
Later, it does the adjustment (calls FightRequest.parseCombatItems() which parses combat item counts from the same html text, which obviously has the counts *before* dropped items were acquired).

What I don't get ... why does this happen on the final round too? Does KoL emit the combat item comboboxes even then, just hidden? Or is it something that only happens with the wowbar?
 

Veracity

Developer
Staff member
And it would make it possible for those of us who do not use the wowbar to try to reproduce it.

Edit: I tried it out and, sure enough, the old fight form is always on the page if you have the wowbar. On rounds before the last one, you have a "(show old combat form)" link to show it. On the last round, that link is not there, but the old form is still in the page html. It's just not visible and there is no way to make it visible.
 
Last edited:
Top