Bug - Cannot Reproduce r10455 - 'use milk' button wastes turns of Got Milk

Fluxxdog

Active member
Got this oddity during a run today:
Code:
Verifying ingredients for milk of magnesium (1)...
Creating milk of magnesium (1)...
You acquire an item: milk of magnesium
Successfully created milk of magnesium (1)
Using 1 milk of magnesium...
You acquire an effect: Got Milk (duration: 10 Adventures)
Finished using 1 milk of magnesium.
Verifying ingredients for milk of magnesium (1)...
Creating milk of magnesium (1)...
You acquire an item: milk of magnesium
Successfully created milk of magnesium (1)
Using 1 milk of magnesium...
You acquire an effect: Got Milk (duration: 10 Adventures)
Finished using 1 milk of magnesium.
Eating 1 Boris's key lime pie...
You gain 19 Adventures
You gain 30 Beefiness
You acquire an item: Boris's key
You gain 4 Fullness
You lose some of an effect: Got Milk
Finished eating 1 Boris's key lime pie.
Eating 1 Jarlsberg's key lime pie...
You gain 20 Adventures
You gain 33 Wizardliness
You gain a Mysticality point!
You acquire an item: Jarlsberg's key
You gain 4 Fullness
You lose some of an effect: Got Milk
Finished eating 1 Jarlsberg's key lime pie.
Eating 1 centipede eggs...
You gain 9 Adventures
You gain 8 Muscleboundness
You gain 10 Enchantedness
You gain 10 Roguishness
You acquire an effect: Somewhat Poisoned (duration: 10 Adventures)
You gain 2 Fullness
You lose some of an effect: Got Milk
Finished eating 1 centipede eggs.
Retrieving character data...
Requests complete.
When I saw I had 9 turns of Got Milk left, I wondered where one of them went. Mafia made one, drink it, then made a second, burning a turn of Got Milk to make it. I would have expected both to made before being consumed.
 

lostcalpolydude

Developer
Staff member
The button makes a milk if necessary, then uses one. Why would it make two milks at the same time when it has no plan to use both of them? Maybe this should be changed to a feature request, but I don't know what it would be for. Unless you have stomach you didn't lose anything there.
 

roippi

Developer
So, you clicked the button twice. Immediately after the first click mafia makes a milk and uses it. In order to fix this bug, you are asking for mafia to somehow know that you were going to hit it a second time and do all the crafting upfront?
 

Fluxxdog

Active member
So, you clicked the button twice.
No, I only clicked it once. Let me explain why it seemed odd. I'm used to mafia only making one milk with one click. When I saw I still had 9 turns, I realized something went wrong and I should have had no turns remaining. All the food I ate was already made, so that couldn't be it. I thought something had been changed recently that used multiple milks to cover fullness. The Stomach of Steel is a less common case, but it used up my last milk that I had, so I'd have to backfarm if I wanted more.
 
Last edited:

lostcalpolydude

Developer
Staff member
So the bug is that mafia wanted to use 2 milks when you clicked the button once. I would ask if you might have accidentally clicked twice rapidly, but I would expect the first click to gray out all of the buttons for a few seconds while the milk is crafted and used, making that particular case of unrecognized human error unlikely.
 

Veracity

Developer
Staff member
How odd. I just finished (my last, I hope) Beecore run. No box servants, and, I was so out of practice that I forgot about Inigo's until my last day. The result was that I spent turns crafting.

Every day (started from day 2), I used milk of magnesium. I would click the "Use Milk" button, KoLmafia would create one milk and use it. Never, ever, did it make two milks. I tried this on various test multis. In every case, pressing that button acquires a single milk and uses it. That's how it's worked for years. I see no change.

Looking at the code, it's hard to understand how it could do anything differently; when you press that button, it gets and uses one milk of magnesium.

Code:
		RequestThread.postRequest( UseItemRequest.getInstance( ItemPool.get( ItemPool.MILK_OF_MAGNESIUM, 1 ) ) );

Looking at your transcript, I see the following block twice:

Verifying ingredients for milk of magnesium (1)...
Creating milk of magnesium (1)...
You acquire an item: milk of magnesium
Successfully created milk of magnesium (1)
Using 1 milk of magnesium...
You acquire an effect: Got Milk (duration: 10 Adventures)
Finished using 1 milk of magnesium.

Each of those is a single "use 1 milk of magnesium". Since milk is multi-usable, if KoLmafia had been using 2 at once, it would have made two at once and used both of them via multiuse.php. I am quite certain that if you look in your session log (not your gCLI transcript) you will see 2 "use 1 milk of magnesium" sections there.

Considering all of the above, I conclude that you pressed the button twice.
 

Fluxxdog

Active member
See that's what I had thought too, but as lost said, when I hit it once, it grays out and then makes milk as needed. It's completely possible it's a glitch because this didn't happen on another character. This may get chalked up to "Cannot Reproduce"
 

roippi

Developer
Hah. I had a similar post typed up (even quoting that block of code from UseItemEnqueuePanel) but refreshed before posting. I even double-checked to make sure if there's any weird special handling for stomach of steel. There is not.

I also conclude that the user clicked the button twice.
 

Rahmuss

Member
Somewhat related to this. I'm using a CLI script which creates 2 milks and then eats to 15 fullness. It often stops the script and asks me if I want to eat without the Got Milk effect. I check the logs and it says that I can't use it, limited by 1 fullness. I'll have to see if I can find the exact messsage and post it here later.
 

Rahmuss

Member
Here we go:

Code:
(usable quantity of milk of magnesium (2) is limited to 1 by remaining fullness)
Using 1 milk of magnesium...
Finished using 1 milk of magnesium.
Eating 3 stinky hi mein...
You gain 24 Adventures
You gain 31 Fortitude
You gain 73 Magicalness
You gain a Mysticality point!
You gain 18 Roguishness
You acquire an effect: Stinky Breath (duration: 5 Adventures)
You gain 23 Adventures
You gain 33 Beefiness
You gain 71 Mysteriousness
You gain 25 Sarcasm
You acquire an effect: Stinky Breath (duration: 5 Adventures)
You gain 24 Adventures
You gain 32 Strongness
You gain 73 Wizardliness
You gain 25 Chutzpah
You acquire an effect: Stinky Breath (duration: 5 Adventures)
Finished eating 3 stinky hi mein.
So where it says "(usable quantity of milk of magnesium (2) is limited to 1 by remaining fullness)" I'm not sure what it means. And it doesn't do that will all of my chars just one of them. He has adventures to spare (usually around 80 when he makes the MoM) so there shouldn't be an issue there. And obviously he eats 3 things which give five fullness to reach 15 fullness after he's done eating. Really not a huge inconvenience, just figured I'd ask.
 

roippi

Developer
You are either a sauceror or have impetuous sauciness permed, so one milk lasts 15 turns. Mafia is saving you from wasting the second milk.
 

lostcalpolydude

Developer
Staff member
You only need to use 1 milk. Your script is erroneously trying to use 2 milk (because it will give 15 turns, and that's all you need to fill your stomach), but mafia saves you from wasting one and gives you a message letting you know why it didn't waste the other one. Mafia isn't doing anything wrong there.
 

Rahmuss

Member
Ah, that makes sense. My char who that happens on is an AT; but he has Impetuous Sauciness, which gives 5 additional adventures of the effect. So that makes sense. Thanks for the info.
 
Top