Bug - Fixed KoLmafia thinks it is round # but KoL thinks it is round #-1

Theraze

Active member
Well, there's 2 different bugs in that thread... one regarding a null round with just the name if auto-attack is on, one added a few days later regarding saucy salve and the molybdenum magnet being considered to increase the round though they both take no time.

The first bug? No clue how to fix, if it's still an issue. The second? Depending on what the "hr" node is, I may be able to fix. But really, the second part of that thread should have been a new bug report instead of hijacking the autoattack bug.
 

Bale

Minion
It's all basically the same problem that mafia does not track rounds in the same way that KoL tracks rounds. Fixing it is tricky because Veracity wants to ensure backwards compatibility for people's CCS.
 

HippoKing

Member
KoL considers autoattacks to happen in round 0. They are sort of like exchanging an action for losing initiative - as I understand it, the way it works is this:

If you lose the jump, the monster acts in round 0.
If you get the jump and act normally, you act first in round 1, then the monster acts in round 1.
If you get the jump and autoattack, you act in round 0, then the monster acts in round 0.

That's why you need to use autoattack for optimal mimic/NPZR farming - they get you another round before meat stops dropping after round 10.

Not that this is really relevant to the bug in the OP, it's just an explanation of other things being discussed in this thread.
 

slyz

Developer
Apparently Mafia's concept of a "round" isn't the same thing as a KoL round. If it was called a "combat counter" or "action number", would that stop the bug reports?

Mafia already parses the KoL round number, maybe it could be kept on a different counter? It would be nice if the KoL round number could be used in a CCS, to replicate the KoL Combat Macro "pastround" predicate.

In any case, there are workarounds if you need to know the round number, either in a CCS or in a consult script. In a CCS you can use a KoL Combat Macro command ("if pastround X"), and in a consult script you would need to parse the round number yourself ("onturn = (\\d+)").
 

Theraze

Active member
Well, part of the question is, since we get the proper round count from KoL, why do we still parse what we think the round should be? We KNOW what it is... the page tells us. It's good for knowing when things are wrong... but wouldn't it make more sense to default our display to the proper KoL reading, not the mafia internal counter?
 

Fluxxdog

Active member
In Magic: the Gathering, the tournament rule when using different language cards is the English translation official ruling on the card. It would make sense with KoL telling us it's round X and mafia listening instead of saying "I think it's round Y" which is absolutely unimportant in the grand scheme of everything.

According to the wiki:
Code:
The main() function in the ASH script being consulted must accept three parameters:

void main(int round, monster mob, string combat)

These values will be supplied by mafia when the consult script is called.
If mafia is already providing an incorrect round number, the CCS would already be broken. So, are CCSs using KoL's number or mafia's number?
 

Theraze

Active member
True... that does present an argument for why mafia should continue to display rounds incorrectly. Though mafia could display the KoL round as its official round, and still keep track of its own consideration and use that for CCS calculation...
 

Bale

Minion
Though mafia could display the KoL round as its official round, and still keep track of its own consideration and use that for CCS calculation...

If you did that, the KoL round would be displayed for decorative purpose while the mafia round would be hidden even though that's the number that actually affects scripts. That sounds like a bad idea and it is the opposite of reconciling the problem.
 

Theraze

Active member
No... what I meant is that the first fight would have looked like this:
[5374] Sorceress' Hedge Maze
Encounter: topiary golem
Strategy: C:\Program Files (x86)\KoLMafia\ccs\default.ccs [default]
Round 0: Theraze loses initiative!
(unable to macrofy due to action: consult SmartStasis.ash)
Monster value: 0
Meat/round from Cocoabo: 7.57
MP/round from Cocoabo: 2.3
HP/round from Cocoabo: 2.3
Profit per round: 29.68
Round 1: Theraze casts SAUCY SALVE!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
You gain 10 hit points
Round 1: Theraze casts SAUCY SALVE!
KoLmafia thinks it is round 3 but KoL thinks it is round 1
You gain 15 hit points
Round 1: Theraze casts SAUCY SALVE!
KoLmafia thinks it is round 4 but KoL thinks it is round 1
You gain 13 hit points
Round 1: Theraze uses the facsimile dictionary!
KoLmafia thinks it is round 5 but KoL thinks it is round 2
Round 2: Gronald coos softly, and nuzzles you with his beak.
You gain 26 hit points
You gain 26 Mana Points
Round 2: Theraze uses the facsimile dictionary!
KoLmafia thinks it is round 6 but KoL thinks it is round 3
Round 3: Gronald lodges the ice-cold pick in your enemy, dealing 11 damage.
Round 3: topiary golem takes 11 damage.
Round 3: Theraze uses the facsimile dictionary!
KoLmafia thinks it is round 7 but KoL thinks it is round 4
Round 4: Theraze uses the facsimile dictionary!
KoLmafia thinks it is round 8 but KoL thinks it is round 5
Round 5: Gronald roots around in the ground, and comes up with some Meat. He wings it to you. LIMIT BREAK!
You gain 198 Meat.
Round 5: Theraze uses the facsimile dictionary!
KoLmafia thinks it is round 9 but KoL thinks it is round 6
Round 6: Gronald coos softly, and nuzzles you with his beak. LIMIT BREAK!
You gain 47 hit points
You gain 47 Mana Points
Round 6: Theraze uses the facsimile dictionary!
KoLmafia thinks it is round 10 but KoL thinks it is round 7
Round 7: Theraze executes a macro!
Round 7: Theraze attacks!
KoLmafia thinks it is round 11 but KoL thinks it is round 8
Round 8: Theraze attacks!
Round 9: Theraze attacks!
Round 10: Theraze attacks!
Round 11: Gronald lodges the ice-cold pick in your enemy, dealing 10 damage.
Round 11: topiary golem takes 10 damage.
Round 11: Theraze attacks!
Round 12: Gronald paws at the ground for a second, and then charges your opponent, bashing him for 21 damage.
Round 12: topiary golem takes 21 damage.
Round 12: Theraze attacks!
Round 13: Theraze attacks!
Round 13: Gronald paws at the ground for a second, and then charges your opponent, bashing him for 42 damage. LIMIT BREAK!
Round 13: topiary golem takes 42 damage.
Round 13: Gronald lodges the ice-cold pick in your enemy, dealing 10 damage.
Round 13: topiary golem takes 10 damage.
Round 14: Theraze attacks!
Round 15: Theraze attacks!
Round 16: Theraze attacks!
Round 17: Gronald paws at the ground for a second, and then charges your opponent, bashing him for 21 damage.
Round 17: topiary golem takes 21 damage.
You lose 36 hit points
Round 17: Theraze attacks!
Round 18: Gronald paws at the ground for a second, and then charges your opponent, bashing him for 21 damage.
Round 18: topiary golem takes 21 damage.
Round 18: Theraze attacks!
Round 19: Theraze attacks!
Round 20: Gronald lodges the ice-cold pick in your enemy, dealing 12 damage.
Round 20: topiary golem takes 12 damage.
Round 20: Theraze attacks!
Round 21: Gronald lodges the ice-cold pick in your enemy, dealing 11 damage.
Round 21: topiary golem takes 11 damage.
Round 21: Theraze attacks!
Round 22: Theraze attacks!
Round 23: Gronald paws at the ground for a second, and then charges your opponent, bashing him for 22 damage.
Round 23: topiary golem takes 22 damage.
Round 23: Theraze attacks!
You lose 39 hit points
Round 24: Theraze attacks!
Round 25: Theraze attacks!
Round 26: Gronald coos softly, and nuzzles you with his beak. LIMIT BREAK!
You gain 47 hit points
You gain 47 Mana Points
Round 26: Theraze attacks!
Round 27: Theraze attacks!
Round 28: Gronald lodges the ice-cold pick in your enemy, dealing 11 damage.
Round 28: topiary golem takes 11 damage.
Round 28: Theraze attacks!
Round 29: Theraze attacks!
Round 30: Gronald paws at the ground for a second, and then charges your opponent, bashing him for 23 damage.
Round 30: topiary golem takes 23 damage.
Round 30: Theraze attacks!
Round 31: Gronald lodges the ice-cold pick in your enemy, dealing 11 damage.
Round 31: topiary golem takes 11 damage.
You acquire an item: hedge maze puzzle
You gain 13 Strengthliness
You gain 31 Wizardliness
You gain 16 Chutzpah

Calling the round number would still return what mafia thinks the round number is... but the displayed and logged one would be the KoL one.
 

Theraze

Active member
Well, the reason for it would be because as it stands, while consults are being called, mafia tells you what the real round (according to KoL, which is where it counts) is. Once you go into your attacks, it stops displaying KoL's corrections... which means that you don't know how close failure is becoming.

Best/what I'd prefer is if CCS were able to both plan on staging commands as well as the true round... if it's going to take 15 rounds to plink the monster, but you've saved 15 rounds and only spent 5, that means you can stasis another 5 TRUE rounds for familiar meat before starting combat with a safe margin. As it currently stands, it would hit panic mode and an intelligent CCS would slap a power or two on the monster to guarantee success at this point, while in actual fact you've still got a significant cushion.

But yeah, even if it's just the display, it would be nice to be able to look back and see where the fight led to failure.
 
Just in case this hasn't been noted:

A few weeks back, I had set KoL to use a macro for auto-attack, but generally that macro did not complete combat (though sometimes it did), returning mafia to its normal CCS routines if it failed.

What I've noticed is that if the ENTIRE combat is handled by an auto-attack macro, then mafia never reports issues with round numbers. If it does other actions afterwards, however, it spams the conflict message. I imagine this is expected behavior, but just in case I'll mention it. I'd need to reproduce this if you want to know if it spams the conflict for the entire fight or only once mafia takes control, as it's been awhile. I believe at that time the conflict resulted in mafia aborting (but not because I told the CCS to), actually. Sorry that's all vague. Again, if more detail is actually needed on that, I can try reproducing with a current version.
 

VladYvhuce

Member
This sort of bug is still around. If you lose initiative and have a KOL combat macro set to run, you'll get something like this:
Encounter: Cholly "The Flaming Kebab" Salisbury
Round 0: VladYvhuce loses initiative!
Round 0: VladYvhuce casts SUMMON LOVE GNATS!
Round 1: VladYvhuce attacks!
Round 2: Jonas starts scratching at the ground, and doesn't stop until he's found a nice cache of meat.
You gain 476 Meat.
Round 2: DNUKLEM flips on its "Extra Turbo" setting, and blows your foe into a nearby snowbank for 36 damage.
Round 2: Hot hobo takes 36 damage.
Round 2: DNUKLEM blows directly at your foe, removing all the heat from his body and causing 38 damage.
Round 2: Hot hobo takes 38 damage.
Round 2: VladYvhuce attacks!
Round 3: Hot hobo takes 165 damage.
Round 3: Jonas headbutts your opponent extra hard, staggering him and doing 135 damage.
Round 3: Hot hobo takes 135 damage.
Round 3: DNUKLEM blows cold air into your opponent's face, freezing his eyeballs and causing 40 damage.
Round 3: Hot hobo takes 40 damage.
Round 3: DNUKLEM blows cold air into your opponent's face, freezing his eyeballs and causing 40 damage.
Round 3: Hot hobo takes 40 damage.
After Battle: unspecified macro action?
After Battle: Hot hobo takes 175 damage.
After Battle: DNUKLEM blows cold air into your opponent's face, freezing his eyeballs and causing 33 damage.
After Battle: Hot hobo takes 33 damage.
After Battle: DNUKLEM flips on its "Extra Turbo" setting, and blows your foe into a nearby snowbank for 32 damage.
After Battle: Hot hobo takes 32 damage.
After Battle: VladYvhuce wins the fight!
After Battle: DNUKLEM blows some of your HP and MP back into you, somehow.
After Battle: You gain 10 hit points
After Battle: You gain 10 Mana Points
After Battle: Jonas does the Funky Turkey, which is like the Funky Chicken, but more violent.
After Battle: You gain 24 Fortitude
After Battle: You gain 57 Mysteriousness
After Battle: You gain 20 Roguishness
It only does this if you lose initiative. Here's from the same session log when I won initiative:
Encounter: Nettles "Brimstone" Smith
Round 0: VladYvhuce wins initiative!
Round 0: VladYvhuce casts SUMMON LOVE GNATS!
Round 1: Jonas wattle-whips your opponent for 137 damage.
Round 1: Hot hobo takes 137 damage.
Round 1: DNUKLEM flips on its "Extra Turbo" setting, and blows your foe into a nearby snowbank for 31 damage.
Round 1: Hot hobo takes 31 damage.
Round 1: DNUKLEM blows cold air into your opponent's face, freezing his eyeballs and causing 35 damage.
Round 1: Hot hobo takes 35 damage.
Round 1: VladYvhuce attacks!
Round 2: Hot hobo takes 243 damage.
Round 2: DNUKLEM blows cold air into your opponent's face, freezing his eyeballs and causing 39 damage.
Round 2: Hot hobo takes 39 damage.
Round 2: DNUKLEM blows cold air into your opponent's face, freezing his eyeballs and causing 32 damage.
Round 2: Hot hobo takes 32 damage.
Round 2: VladYvhuce wins the fight!
After Battle: DNUKLEM cheers wildly! It's your biggest fan! The encouragement refreshes your HP and MP!
After Battle: You gain 10 hit points
After Battle: You gain 10 Mana Points
After Battle: Jonas does the Funky Turkey, which is like the Funky Chicken, but more violent.
You acquire an item: hobo nickel
After Battle: You gain 33 Muscleboundness
After Battle: You gain 47 Mysteriousness
After Battle: You gain 25 Roguishness
 

Veracity

Developer
Staff member
When we see this message, KoLmafia has just submitted a combat action which KoL determined did not actually advance the combat round counter.

For example, if you pickpocket in the Relay Browser and then say "script" - which runs your CCS - the first action of which is "steal", we will submit another pickpocket request, which KoL will reject without advancing the round counter.

Whether or not we should have submitted that combat directive, this is a harmless response.

And, in other cases, it has been a useful spading tool: we have learned that such-and-such an action did not actually take a round of the fight.

Revision 17473 will take KoL's reported round # and accept it - which means that subsequent actions in the same combat will no longer be "off by one".

This is as good as it's going to get for this bug report.
 

zarqon

Well-known member
Not sure if it's relevant to your purposes Veracity, but the round number reported by KoL may also be off, in the case that multiple rounds are present on the page. The onturn var that KoL gives us is the current round number only at the top of the page. Additional actions on the same page may or may not advance the round counter afterwards.

For example, on round 1, a player submits a macro which casts Weaksauce, then Salve, then an item he no longer has (for example the beehive, which I always have to "refresh inv" to get rid of). The resulting page contains onturn = 2, but the actual round number is 3 or maybe 4. Weaksauce took a round, Salve didn't, and attempting to use the nonexistent item may or may not advance the counter, I've never confirmed that.

So, it's not particularly simple to parse the round number from KoL's combat pages, despite the handy JavaScript variable ostensibly containing the round number.
 

Immelan

New member
Something in the recent change is causing an infinite combat loop with the Turbo skill. Before, if Turbo did not fire due to cool down timer, it would go to the next thing in my CCS. Now, it just sits there trying to repeat the skill. This bug was first encounted on the 17473 build.

Build 17472
Encounter: garbage tourist
Round 0: immelan wins initiative!
Round 1: immelan tries to steal an item!
You acquire an item: bag of park garbage
You gain 23 Meat.
You gain 5 Meat.
Round 2: immelan casts EXTRACT!
You acquire an item: Source essence (2)
You gain 15 Meat.
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 4: immelan casts POCKET CRUMBS!
KoLmafia thinks it is round 5 but KoL thinks it is round 4
You gain 14 Meat.
Round 5: immelan casts RUN LIKE THE WIND!
KoLmafia thinks it is round 6 but KoL thinks it is round 5
You gain 97 Meat.

Build 17473
Encounter: horrible tourist family
Strategy: C:\Users\Neph\Desktop\kol - Copy\ccs\default.ccs [horrible tourist family]
Round 0: immelan wins initiative!
Round 1: immelan tries to steal an item!
You gain 13 Meat.
Round 2: immelan casts EXTRACT!
You acquire an item: Source essence (2)
You gain 14 Meat.
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: immelan casts TURBO!
 
Top