New Content - Implemented July IotM - Cat Burglar (Familiar)

PeKaJe

Member
The latest updates seem to make the counting work right, at least I'm pretty sure today's bonuses hit in ways that previously miscounted. I also went through my logs with that familiar, to date. All heist messages arrived on the expected turn, regardless of when bonus charges applied, so RNG can probably be excluded. The only thing that could possibly be missing now would be a Valhalla reminder to spend any pending heists. Nice to have, far from need to have, though.
 

antipasta

Member
Would it be possible to get a warning about unused heists on ascension? I keep letting the heists pile up in case something extra valuable shows appears, then losing them all when I ascend.
 

Malibu Stacey

Active member
Counting of heists and adventures until the next heist appear to be suffering from an off-by-one error.
heists_mafia.pngheists_actual.png

Yesterday the counter was showing 39/40 and 0/2 but I actually had 3 available. When it showed 38/40 I had 2 available so it looks like both counters have a similar problem.
 
Last edited:

Malibu Stacey

Active member
I am using the equipment. Haven't tried without out it but I'll keep an eye on the messages & check the counter to see if there's one being missed.
 

Malibu Stacey

Active member
Figured out one of the issues. I had one heist carried over from yesterday, mafia isn't showing any yet.

burglar_mafia.PNG
terrarium_burglar.PNG

edit: found the non-tracked message too, it's the second one of these two.

Code:
After Battle: Light-Fingered Haroun disguises himself as someone who is asleep. Or... maybe he's just asleep.
After Battle: Light-Fingered Haroun cracks his knuckles and looks around for something to steal.
Preference _catBurglarCharge changed from 8 to 9

The first one I've seen a few times in the last 3 or 4 days of logs, the second one seems to happen when a heist becomes available (not equipment related).
 
Last edited:

AlbinoRhino

Active member
Perhaps if the user visits the heists page voluntarily, mafia should parse the heists remaining and update it's prop if there is a discrepancy? So you could at least force a correction. And perhaps, the ascension page should visit and check for discrepancies...as my cat didn't show up there at all...although there were heists left according to the game...but mafia thought there were none. After manually setting the prop, the cat appeared on the ascension page, as expected.
 

Malibu Stacey

Active member
Actually it looks like all the 'heist is ready' messages might not be incrementing the counter

Code:
After Battle: Light-Fingered Haroun grabs a quick nap with his sleep mask, so he'll be fresh for the upcoming heist.
After Battle: Light-Fingered Haroun does some stretching exercises to prepare for his upcoming heist.
Preference _catBurglarCharge changed from 29 to 30

Perhaps if the user visits the heists page voluntarily, mafia should parse the heists remaining and update it's prop if there is a discrepancy? So you could at least force a correction. And perhaps, the ascension page should visit and check for discrepancies...as my cat didn't show up there at all...although there were heists left according to the game...but mafia thought there were none. After manually setting the prop, the cat appeared on the ascension page, as expected.

It doesn't look like the heists are manually tracked at all. I think they're simply calculated from whatever the counter is at since they're available at known intervals.
 

Darzil

Developer
Well, that one is actually working as originally spaded. If you get a heist from the first message, we don't get charge from the second. Maybe that has changed?

Code:
			case FamiliarPool.CAT_BURGLAR:
				if ( responseText.contains( "takes note of any security cameras in the area" ) ||
					responseText.contains( "watches carefully to see if there are any guards and when they change shifts" ) ||
					responseText.contains( "looks around for unlocked windows and accessible vents" ) ||
					responseText.contains( "stands around casually, definitely just loitering and not casing the joint at all" ) )
				{
					Preferences.increment( "_catBurglarCharge" );
				}
				if ( responseText.contains( "grabs a quick nap with his sleep mask, so he'll be fresh for the upcoming heist" )||
					responseText.contains( "takes advantage of the downtime to grab a few z's" ) ||
					responseText.contains( "disguises himself as someone who is asleep" ) )
				{
					Preferences.increment( "_catBurglarCharge" );
				}
				if ( responseText.contains( "gets a shifty look in his eyes. Looks like he's ready for a heist and/or caper" ) ||
					responseText.contains( "cracks his knuckles and looks around for something steal" ) ||
					responseText.contains( "does some stretching exercises to prepare for his upcoming heist" ) )
				{
					// Current theory is that heist message can happen even when the charge is reached from sleepmask trigger later
					// in the combat text. And that it resets charge to next heist to 0. We round to catch other small errors too.
					int charge = Preferences.getInteger( "_catBurglarCharge" ) + 1;
					Preferences.setInteger( "_catBurglarCharge", (int) Math.round( charge / 10 ) * 10 );
				}
				break;

And yes, the corrections thing annoys me. I started off with correction code in there, but there were so many little ways it could be thrown off, and as it's exponential, could get very out of sync.

If someone can write some solid code that will do it, without additional page hits, I'm all ears.
 
Last edited:

Darzil

Developer
edit: found the non-tracked message too, it's the second one of these two.

Code:
After Battle: Light-Fingered Haroun disguises himself as someone who is asleep. Or... maybe he's just asleep.
After Battle: Light-Fingered Haroun cracks his knuckles and looks around for something to steal.
Preference _catBurglarCharge changed from 8 to 9

The first one I've seen a few times in the last 3 or 4 days of logs, the second one seems to happen when a heist becomes available (not equipment related).

Do you have the html of that message?
 

AlbinoRhino

Active member
To me it looks like KoLmafia.java is setting catBurglarBankHeists based on the charges seen today and and the heists used today as well as its own previous value. And then CharPaneDecorator.java is again calculating the part based on charges gained today and adding it to the catBurglarHeists amount (which should have already taken that into account?).
 

AlbinoRhino

Active member
The bug is interestingly intermittent as well. If you are progressing towards your second heist and your progress is below 10, the charpane will over-report your heists available by 1. Once your progress is 10 or above, the charpane resumes reporting the correct amount.
 

Malibu Stacey

Active member
Well, that one is actually working as originally spaded. If you get a heist from the first message, we don't get charge from the second. Maybe that has changed?

Maybe it's been stealth fixed if it was working differently before? I didn't do much spading on the Cat Burglar when it was released.

This also happened yesterday.

Code:
[6468] The Deep Dark Jungle
Encounter: smoke monster
Preference _lastCombatStarted changed from 20181123073317 to 20181123073333
Round 0: Malibu Stacey wins initiative!
Round 1: Malibu Stacey casts SHATTERING PUNCH!
Round 2: Malibu Stacey wins the fight!
After Battle: Light-Fingered Haroun, dressed as Beelzebub, fires a bolt of red lightning from his pitchfork into your head.
After Battle: You gain 5 Mojo Points
After Battle: Light-Fingered Haroun shows you his new dance move that he calls the "Totally Gonna Rob This Joint".
You acquire an item: transdermal smoke patch
After Battle: You gain 36 Strengthliness
After Battle: You gain 38 Wizardliness
After Battle: You gain 101 Cheek
After Battle: Light-Fingered Haroun disguises himself as someone who is asleep. Or... maybe he's just asleep.
After Battle: Light-Fingered Haroun takes note of any security cameras in the area.
Preference _shatteringPunchUsed changed from 1 to 2
Preference garbageChampagneCharge changed from 7 to 6
Preference testudinalTeachings changed from 150:2|211:1|203:2|267:3|266:4|198:0|213:0|207:0|206:3|214:5|210:5 to 150:2|211:1|203:2|267:4|266:4|198:0|213:0|207:0|206:3|214:5|210:5
Preference _catBurglarCharge changed from 67 to 68
Preference _catBurglarCharge changed from 68 to 69

[6468] The Deep Dark Jungle
Encounter: smoke monster
Preference _lastCombatStarted changed from 20181123073333 to 20181123073430
Round 0: Malibu Stacey wins initiative!
Round 1: Malibu Stacey casts SHATTERING PUNCH!
Round 2: Malibu Stacey wins the fight!
After Battle: You gain 4 Chutzpah
After Battle: Light-Fingered Haroun uses an infernal Beelzebub incantation to give you a surge of magical power, which probably won't have any repercussions.
After Battle: You gain 5 Mojo Points
After Battle: Light-Fingered Haroun does a dance so sneaky, it looks like he's just standing still.
You acquire an item: transdermal smoke patch
After Battle: You gain 49 Beefiness
After Battle: You gain 39 Wizardliness
After Battle: You gain 84 Smarm
After Battle: Light-Fingered Haroun cracks his knuckles and looks around for something to steal.
Preference _shatteringPunchUsed changed from 2 to 3
Preference garbageChampagneCharge changed from 6 to 5
Preference testudinalTeachings changed from 150:2|211:1|203:2|267:4|266:4|198:0|213:0|207:0|206:3|214:5|210:5 to 150:2|211:1|203:2|267:5|266:4|198:0|213:0|207:0|206:3|214:5|210:5

main.php?heist=1
Took choice 1320/2: Nevermind
choice.php?whichchoice=1320&pwd&option=2

That manual check of the terrarium showed 4 heists (3 from 70 charges plus one carried over from the previous day). Something is causing the 3rd if statement in your code snippet to not trigger. I'll try & get the HTML for those pages today.
 

Malibu Stacey

Active member
3rd heist appears to have triggered that 3rd if statement

Code:
After Battle: Light-Fingered Haroun takes advantage of the downtime to grab a few z's.
After Battle: Light-Fingered Haroun does some stretching exercises to prepare for his upcoming heist.
Preference testudinalTeachings changed from 150:3|211:0|203:5|267:5|266:4|198:3|213:0|207:3|206:3|214:5|210:5 to 150:3|211:0|203:5|267:0|266:4|198:3|213:0|207:3|206:3|214:5|210:5
Preference _catBurglarCharge changed from 67 to 68
Preference _catBurglarCharge changed from 68 to 60

HTML attached (I missed the HTML from the 2nd one as I wasn't paying attention properly & hadn't manually incremented the counter when it failed after the first one).
View attachment cat_burglar_3rd_heist.txt
 

Darzil

Developer
To me it looks like KoLmafia.java is setting catBurglarBankHeists based on the charges seen today and and the heists used today as well as its own previous value. And then CharPaneDecorator.java is again calculating the part based on charges gained today and adding it to the catBurglarHeists amount (which should have already taken that into account?).

Not exactly. What KoLmafia.java should be doing is before resetting the underscore preferences, setting catBurglarBankHeists based on _catBurglarCharge from yesterday (and banked heists and heists complete). It shouldn't include any from today.
 

Darzil

Developer
The bug is interestingly intermittent as well. If you are progressing towards your second heist and your progress is below 10, the charpane will over-report your heists available by 1. Once your progress is 10 or above, the charpane resumes reporting the correct amount.

If SHOULD (but clearly isn't) be impossible to be progressing towards your second heist with progress below 10, as you should have at least 10 to be in that state.
 
Top