Bug - Fixed "auto" button on choice.php doesn't always work

Veracity

Developer
Staff member
Sometimes - but sometimes not.

For example, "auto" sent me through the whole chain of "Lights Out in the Bedroom".
It showed me the text and the buttons.
The correct one to automate had an arrow pointing to it.
I said "auto" and it followed the chain and showed me the final response.

Several following choice chains did not behave that way.
It showed me the text and the buttons - with the correct one pointed to.
I hit "auto" and it followed the single choice, showed me the text and buttons - with correct button designated.
And so on. I had to hit auto on every page.

Here is what happened in the Laboratory, for example.

Code:
-----From Browser-----
GET /choice.php?action=auto HTTP/1.1
----------
Starting relay script: choice.ash
Requesting: https://www.kingdomofloathing.com/choice.php?whichchoice=903&option=1&pwd
Retrieved: https://www.kingdomofloathing.com/choice.php?whichchoice=903&option=1&pwd
Encounter: Lights Out in the Laboratory
Processing results...
Finished relay script: choice.ash (11126 bytes)
-----To Browser-----
HTTP/1.1 200 OK
----------

Rinse and repeat.

What does the "auto" button do? It makes the browser submit "/choice.php?action=auto".
We saw that.

RelayAgent gets it:

Code:
    } else if (this.path.equals("/choice.php?action=auto")) {
      ChoiceManager.processChoiceAdventure(this.request, "choice.php", ChoiceManager.lastResponseText);
...

and passes the current RelayRequest to ChoiceManager, which will attempt to automate through the entire choice chain using that request - not CHOICE_MANAGER..

The thing about RelayRequests (as used to connect to the browser) is that you can have a choice override script.
I have one and it is kicking in and submitting the request and getting the response and writing it - which sends it back to the browser, rather than simply letting ChoiceManager look at it and continue automating.

Perhaps the issue could be solved in the relay script:
If it notices that it is being asked to process a choice request that is taking a decision, perhaps it should not try to process it?

Or perhaps we shouldn't invoke relay scripts if KoLmafia itself is automating?
The automation was kicked off by the browser, but I don't want the relay script to hijack it.

What to do?
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Or perhaps we shouldn't invoke relay scripts if KoLmafia itself is automating?
The automation was kicked off by the browser, but I don't want the relay script to hijack it.
This seems right to me - can we think of a scenario in which we'd want to see the contents of such a relay script while automating?
 

zarqon

Well-known member
Excellent. Related question: will "auto" still run choiceAdventureScripts? I would want that to fire while automating. I'm unable to test at the moment.
 
Top