Bug - Won't Fix r10923 - Mafia counters count down after aAS instead of before

Fluxxdog

Active member
Code:
Maximizing... [COLOR="#0000FF"]<==start of aAS[/COLOR]
104 combinations checked, best score 2.0
732 Mysticality (701201 SubMysticality) needed to get to level 30
12 Mysticality (2801 SubMysticality) needed to get to level 12
172 SubMysticality needed to reach 114 Mysticality
Using 1 dance card...
Finished using 1 dance card.
Now turn your head and cough...
Raiding the fridge...
looking for rainbows...
Getting pumped up...
Your He-boulder's Yellow ray is ready to go!
Your He-boulder's Blue ray is ready to go!
Your He-boulder's Red ray is ready to go!
Adventure finished

> counters

Last semirare found 146 turns ago (on turn 437) in Sleazy Back Alley

Unexpired counters:
Dance Card (2)
Semirare window begin (14)
Semirare window end (54)
My aAS uses Dance Cards as I get them, but I noticed a counter of 2 instead of 3 in the charpane on the relay. Any counters mafia creates should be counted down when an adventure is consumed (right after the end of combat or a non-com adventure) and before the aAS script fires.
 

Veracity

Developer
Staff member
KoLmafia counters do not "count down". They are set to expire at a particular turn number. The turn number "counts up" when the charpane refreshes and we notice that it has increased. An alternative approach - a bad and error prone one - would be for KoLmafia to increment the turn counter whenever we happen to think a turn was consumed. That is guaranteed to break when new choice adventures come along that give you a 0-turn option, for example.

We are not going to change how KoLmafia counts turns.
Nor are we going to force a charpane refresh before the after adventure script executes.
Nor are we going to change execution of the afterAdventureScript to be triggered by a charpane refresh.

If your script depends on things that we detect from the charpane - like the turn counter and your Meat balance - you are welcome to force a charpane refresh yourself.
 

Fluxxdog

Active member
That's reasonable, but I found a second side effect. Mafia has the wrong status information altogether. If you have one turn of an effect left, Mafia says you have that effect during your aAS script even though it's actually wiped out at the end of combat. So it wasn't Mafia counting wrong, just working with the wrong information. I looked at my session logs and after 3 adventures, I got my Rotting Matilda NC, but Mafia was telling me it was time for it after only 2 turns. Looking at other logs, I've been seeing that buffs that I have slated to renew when they hit zero have actually been skipping a turn without them.

I think what confuses me is KoL sends out a fresh charpane each time it changes, doesn't it? I thought Mafia would intercept that and use it automatically without requesting a new one.
 

Veracity

Developer
Staff member
That is correct. However, when we run the afterAdventureScript, the KoL-generated charpane has not yet arrived.
 
Top