Bug - Fixed gooseDronesRemaining sometimes not decrementing

Sometimes after item drops, gooseDronesRemaining changes after a dupe, but sometimes it's missed. It eventually fixes itself after a future dupe, but it looks like there are errors in text matching for goose drone activation.
 

Veracity

Developer
Staff member
That is not enough information to even begin looking at this.
Show us the text that did not result in drones decrementing.

Edit: What version of KoLmafia are you using?
 
Here's an excerpt from my log today, running KoLmafia r26534.

I started with 2 drones active. The first 2 combats, an item is duped and the drones correctly decrement. Then I switch in the goose and emit drones. The drones increase by 1, which is captured. But the drones decreasing by 1 at end of combat is not captured, and mafia continues to think that I have 1 drone.

My best guess is that if you go into a combat with 0 drones, it doesn't check to see if you use any drones, even if you emitted drones in that same combat.

Note that these combats were all done with a combat macro and run with run_combat(), so that all rounds after the initial start of combat loaded in a single page load, in case that matters.

Code:
[1240] Spooky Putty Monster
Encounter: Witchess Knight
Adjusted combat item count: Spooky Putty sheet (-1)
Round 1: sketchysolid executes a macro!
Round 1: sketchysolid casts CURSE OF WEAKSAUCE!
Round 2: sketchysolid uses the porquoise-handled sixgun and uses the Mayor Ghost's scissors!
Round 3: sketchysolid uses the Spooky Putty sheet!
You acquire an item: Spooky Putty monster
Preference spookyPuttyCopiesMade changed from 1 to 2
Preference spookyPuttyMonster changed from  to Witchess Knight
Round 4: sketchysolid attacks!
Round 5: sketchysolid wins the fight!
You acquire an item: jumping horseradish
Preference gooseDronesRemaining changed from 2 to 1
After Battle: One of the matter duplicating drones seems to coalesce around the jumping horseradish and then transforms into an exact replica. 1 more drone is still circling around.
You acquire an item: jumping horseradish
You acquire an item: human musk
Preference redSnapperProgress changed from 10 to -1
After Battle: You see a weird thing out of the corner of your eye, and you grab it. Far out, man!
You acquire an item: garbage-juice-flavored Hob-O
Preference _juneCleaverFightsLeft changed from 1 to 0
Preference _juneCleaverHot changed from 1 to 2
Preference redSnapperProgress changed from -1 to 0
This combat did not cost a turn
Preference lastAdventure changed from None to The Hidden Bowling Alley

> Starting a combat by using a(n) Spooky Putty monster.

use 1 Spooky Putty monster
Preference spookyPuttyMonster changed from Witchess Knight to
Preference lastAdventure changed from The Hidden Bowling Alley to None

[1240] Spooky Putty Monster
Encounter: Witchess Knight
Round 0: sketchysolid wins initiative!
Preference cosmicBowlingBallReturnCombats changed from 0 to -1
You acquire an item: cosmic bowling ball

[1240] Spooky Putty Monster
Encounter: Witchess Knight
Adjusted combat item count: Spooky Putty sheet (-1)
Round 1: sketchysolid executes a macro!
Round 1: sketchysolid casts CURSE OF WEAKSAUCE!
Round 2: sketchysolid uses the porquoise-handled sixgun and uses the Mayor Ghost's scissors!
Round 3: sketchysolid casts BOWL STRAIGHT UP!
You acquire an effect: Cosmic Ball in the Air (7)
Preference _cosmicBowlingSkillsUsed changed from 1 to 2
Preference cosmicBowlingBallReturnCombats changed from -1 to 6
Round 4: sketchysolid uses the Spooky Putty sheet!
You acquire an item: Spooky Putty monster
Preference spookyPuttyCopiesMade changed from 2 to 3
Preference spookyPuttyMonster changed from  to Witchess Knight
Round 5: sketchysolid attacks!
Round 6: sketchysolid wins the fight!
You acquire an item: jumping horseradish
Preference gooseDronesRemaining changed from 1 to 0
You acquire an item: jumping horseradish
After Battle: You think you see a weird thing out of the corner of your eye, but it turns out to be nothing. Which is actually pretty weird, if you think about it, man.
Preference _juneCleaverHot changed from 2 to 3
Preference redSnapperProgress changed from 0 to 1
This combat did not cost a turn
Preference lastAdventure changed from None to The Hidden Bowling Alley
> Puttying Witchess Knight.

familiar Grey Goose (56 lbs)

equip hat giant yellow hat

equip weapon yule hatchet

equip off-hand yule hatchet

equip acc1 teacher's pen

equip acc2 teacher's pen

take from closet: 1 teacher's pen
You acquire an item: teacher's pen

equip acc3 teacher's pen

> Starting a combat by using a(n) Spooky Putty monster.

use 1 Spooky Putty monster
Preference spookyPuttyMonster changed from Witchess Knight to
Preference lastAdventure changed from The Hidden Bowling Alley to None

[1240] Spooky Putty Monster
Encounter: Witchess Knight
Round 0: sketchysolid wins initiative!
Preference cosmicBowlingBallReturnCombats changed from 6 to 5

[1240] Spooky Putty Monster
Encounter: Witchess Knight
Adjusted combat item count: Spooky Putty sheet (-1)
Round 1: sketchysolid executes a macro!
Round 1: sketchysolid casts CURSE OF WEAKSAUCE!
Round 2: sketchysolid uses the porquoise-handled sixgun and uses the Mayor Ghost's scissors!
Round 3: sketchysolid uses the Spooky Putty sheet!
You acquire an item: Spooky Putty monster
Preference spookyPuttyCopiesMade changed from 3 to 4
Preference spookyPuttyMonster changed from  to Witchess Knight
Round 4: sketchysolid casts EMIT MATTER DUPLICATING DRONES!
Preference gooseDronesRemaining changed from 0 to 1
Round 5: sketchysolid attacks!
Round 6: sketchysolid wins the fight!
Your familiar gains a pound: Fifty Shades, the 6 lb. Grey Goose
You acquire an item: jumping horseradish
You acquire an item: jumping horseradish
You acquire an item: bottle of rum
This combat did not cost a turn
 

Veracity

Developer
Staff member
Yes, "Log cleaned HTML tree of fight pages" applies to your DEBUG log - and I like that setting. It is very useful!

You showed me a session log.

The DEBUG log is what you get when you do this:

> debug on
.... do stuff....
> debug off

There will be a file named DEBUG_20220706.txt in your KoLmafia directory.
 
Okay. I cut out a bunch of irrelevant stuff, but here's the debug log from a few fights. gooseDronesRemaining goes down from 2 to 1, then from 1 to 0, then grey goose is switched in to emit drones, and they go from 0 to 1, but they don't decrement in that battle when they are in fact used up.

Side note: I don't like how mafia's cleaned up HTML includes password hashes. I've done a find and replace because I'm paranoid, but maybe that should be handled by the debug logger, too?
 

Attachments

  • DEBUG_20220707.txt
    754.9 KB · Views: 1

Veracity

Developer
Staff member
If you are no longer logged in, the password hash is no longer relevant. It's not actually based on your login password. It is a token used by KoL to tag the particular session. We don't include the hashes in URLs we log for request/response - we suppress them down to "&pwd" - but if they are embedded in links in the page, we don't edit those.

Thanks for the DEBUG log! I will extract what I need from it and code up a test which will, I hope, fail - until I fix the code and the test then passes. :)
 

Veracity

Developer
Staff member
Yeah, it's because you had multiple rounds in a macro. We make a "TagStatus" object at the beginning of walking the HTML tree which contains various character state things - including number of drones flying - and never updated it across multiple rounds in the same HTML response. We needed to update # of drones. At least.

Your HTML file showed it, I wrote a test which showed the failure, I fixed the code, and the test now passes.

PR out for review.

 
Top