Bug - Fixed The option to show both the Combat Action Bar and the old form at the same time causes problems for automating combat

MCroft

Developer
Staff member
So, seeing this setting, I turned it on, hoping it would be convenient, because sometimes I do pull up the old form.

It would be, but it's causing the automation of combat to fail.

If I press the script button on the CAB or if I use the "Begin" button the the Swing GUI, it returns "You twiddle your thumbs" and stops the sequence. In the browser, pressing the button a second time causes the script to run.

I suspect this variant is causing our matching to fail somewhere, but I haven't tracked it down.
 

Attachments

  • DEBUG_20230902.txt
    58.4 KB · Views: 1
Last edited:

Veracity

Developer
Staff member
You "saw this setting" where? This is a KoL setting?
I have literally never used the CAB. Is the "Script" button something that we add to the CAB?
You have the Relay Browser open, but you hit the Begin button on the GUI and that fails?

The old combat form is already on every fight page that KoL sends us, whether or not the CAB is active.
It's just hidden. I assume the KoL setting simply un-hides it.

How odd.

Seems like you could get a round zero fight response with and without that option, and see exactly how they differ.
Seems like it would be a good learning experience for you to find out how we parse the fight page. :)
 

MCroft

Developer
Staff member
Yeah, it’s on my plate, but I like to document bugs in case someone else finds them or finds them after I fix things. I will make a better description, and see what I learn.
 

MCroft

Developer
Staff member
So, some screenshots with a better description.
1: First I validated that the "Scripts" button on the CAB was inserted by KoLmafia (it is. It is not in vanilla KoL, where it would not make sense)
2: Then I opened the Options and went to Combat Options. I enabled Combat Options Bar and fought an Eldritch tentacle.
3: Clicking on the script button ran my CCS.
4: Then I switched on the second option "old form with Combat Action Bar". I fought a caveman hippy at that point.
5: Clicking on the script button returned "You twiddle your thumbs".
6: Clicking on it a second time ran my CCS selections through to the end of the combat (as expected).

Attached is an (I hope adequately annotated) Debug log
 

Attachments

  • After Pressing Script Button First Time.png
    After Pressing Script Button First Time.png
    32.8 KB · Views: 4
  • CAB from RelayBrowser with KoLmafia.png
    CAB from RelayBrowser with KoLmafia.png
    21.7 KB · Views: 5
  • Options Combat Pane with hover text.png
    Options Combat Pane with hover text.png
    29.9 KB · Views: 5
  • DEBUG_20230904.txt
    386.5 KB · Views: 0
Last edited:

MCroft

Developer
Staff member
So the button is getting the wrong value. The code is working right to use it, but the static decorator is thinking the the currentRound is 0 (and thus we need that link to go to main.php, not the fight.php with a macro).

That's because FightRequest.updateRoundData() thinks we're no long in battle because it can't find the text "(show old combat form)", because it's not there.
My replacement line is to check if response.Text.contains("\'fightform\'") to detect when a fight form is on the page. I want to test it more extensively and to write a test for this difference.
Java:
    boolean stillInBattle =
        finalRound
            && !won
            && (FightRequest.pokefam
                ? responseText.contains("action=fambattle.php")
                : (limitmode == LimitMode.BATMAN || FightRequest.innerWolf)
                    ? responseText.contains("action=\"fight.php\"")
                    : Preferences.getBoolean("serverAddsCustomCombat")
                        ? responseText.contains("(show old combat form)")
                        : KoLCharacter.inDisguise() ? fightCount > 1 : fightCount > 0);
 
r27580. Anyone who want to test, please do.
running on it now, I seem to be getting something strange happening where it's trying to run combats twice, and this breaks tracking for a few things:

[226705] Noob Cave
Preference lastEncounter changed from Adjust your Parka to crate
Encounter: crate
Round 0: Shiverwarp wins initiative!
Round 1: Shiverwarp executes a macro!
Round 1: Shiverwarp casts TRANSCENDENT OLFACTION!
You acquire an intrinsic: On the Trail
Preference olfactedMonster changed from Sloppy Seconds Burger to crate
Preference _olfactionsUsed changed from 1 to 2
Round 2: Shiverwarp casts OFFER LATTE TO OPPONENT!
Preference relayCounters changed from 226727:Latte Monster loc=*:snout.gif to
Preference relayCounters changed from to 226734:Latte Monster loc=*:snout.gif
Preference _latteMonster changed from Sloppy Seconds Sundae to crate
Preference _latteCopyUsed changed from false to true
Round 3: Shiverwarp casts GALLAPAGOSIAN MATING CALL!
Preference _gallapagosMonster changed from Sloppy Seconds Burger to crate
Round 4: Shiverwarp casts RETURN!
Round 5: You lose 4,791 hit points
Round 5: You gain 1 Mysteriousness
Preference _juneCleaverFightsLeft changed from 4 to 3
Preference _juneCleaverStench changed from 5 to 6
Round 5: Shiverwarp executes a macro!

It tries to execute (or is showing the attempt to?) macros twice per combat, it does the second after winning
 

Manendra

New member
Yeah, on r27580, this broke bander run tracking for sure. Not sure what else.

Code:
Visit to Woods: The Black Forest in progress...

[573] The Black Forest
Preference lastEncounter changed from black panther to All Over the Map
Encounter: All Over the Map
Preference lastEncounter changed from All Over the Map to You Found Your Thrill
Encounter: You Found Your Thrill
Preference lastEncounter changed from You Found Your Thrill to blackberry bush
Encounter: blackberry bush
Round 0: manendra wins initiative!
Round 1: Misshapen Ragamuffin Yoshi hums a snatch of Ode to Booze and hiccoughs loudly.
Round 1: manendra executes a macro!
Round 1: manendra casts RETURN!
Round 2: Misshapen Ragamuffin Yoshi snatches you up in his jaws, tosses you onto his back, and flooms away, weaving slightly and hiccelping fire. You shout "Yeeeeeah!" as the combat becomes a small dot, far below you.
Round 2: You gain 1 Magicalness
You acquire an item: Eye Agate
Preference _juneCleaverFightsLeft changed from 5 to 4
Preference _juneCleaverStench changed from 50 to 51
Round 2: manendra executes a macro!
Cannot find monster.
Preference _pantsgivingCount changed from 121 to 122
Preference lastCopyableMonster changed from black panther to blackberry bush

Preference _concoctionDatabaseRefreshes changed from 902 to 903
 
Top