Bug - Fixed combat macro automation

Veracity

Developer
Staff member
Whew!

(Actually, I was claiming to fix Darzil's report, not necessarily yours.)

I have seen some oddnesses recently (before this fix):

- Stationary buttons at the beginning of a fight showing only "again" on the first round
- The session log skipping the "You won (or lost) initiative" line

Both of which would lead to the kind of thing you and Darzil reported.

I'm going to keep this open as I continue to keep my eyes open for things of this sort, although I'm hoping for the best.
 

ckb

Minion
Staff member
Ack! So close. My fight worked fine when I tried it in aftercore, and then I ascended and it failed like this:

Code:
Source Terminal: educate compress.edu
Source Terminal used.
Source Terminal: educate digitize.edu
Source Terminal used.
BUGGER: visit_url

[7] Chateau Painting
Encounter: writing desk
BUGGER: run_combat
Encounter: writing desk
Round 0: ckb1 loses initiative!
Source Terminal: educate extract.edu
choice.php: redirected to a fight page.

So it did not run the fight from run_combat() and did not abort, then had a problem when my script tried to access the Source Terminal (because it was actually still in the writing desk fight).

Edit: I also realized that because I still have a debug command in my script, it captured debug logs for both my fights (the successful one in aftercore and the failed one in-run).
 

Attachments

  • DEBUG_20170709.txt
    120.6 KB · Views: 184
Last edited:

Veracity

Developer
Staff member
I found a reproducible bug. Unfortunately, it has nothing to do with automation. Or at least, it is not restricted to automation.

In the CLI, type "terminal educate extract" (for example
In the Relay Browser, adventure somewhere which redirects to a fight.
The CLI and Session log skip telling you about Initiative
The stationary buttons show only an "again" button.

The issue is that when you go into a choice that you can walk away from (like the Source Terminal), when you go to adventure.php, which redirects to fight.php, it still thinks you are "handlingChoice" - and the post2 method in that condition says "there is no result for this choice", which therefore skips tracking the fight.php round.

The problem seems to be that when you go to adventure.php, that would clear the handlingChoice flag - except it redirects, and we do not clear it on a redirect.

This is going to take a fair amount of research in order to understand the actual root cause and correct fix.

Fortunately, it is 100% reproducible for no cost.

Eventually.
 

ckb

Minion
Staff member
I found a reproducible bug. Unfortunately, it has nothing to do with automation. Or at least, it is not restricted to automation.

This. Wow, thanks for tracking this down. I was able to get a work around for my automation by doing an extra visit_url() before I tried my combat. This essentially walks away from the terminal choice and clears the flag (I think).
 

Veracity

Developer
Staff member
Revision 18147 should fix that.

If you walk away from a choice to a location which does not redirect, we already correctly noticed that you were no longer in a choice.

If you walk away from a choice to a location which does redirect, we will now mark that you are no longer handling a choice.

Sorry it took so long. I'm only working on KoLmafia during the weekends, these days.
 

ckb

Minion
Staff member
I have had no issues on this for quite some time, I believe we can mark it as fixed.
 
Top