I REALLY shouldn't have to do this, but...
Poking around in autoscend. In quests/optional.ash in LX_acquireEpicWeapon:
Code:
return autoAdv($location[The Unquiet Garves]);
This is literally the only call to adventure in the Unquiet Garves until you get Epic Weapon.
So, what the f*** does autoAdv want to do at that location? You seemed to say it called run_choice(-1) if it encounters a choice adventure?
That is in auto_adventure.ash:
Code:
return autoAdv(1, loc, "");
So it runs a single adventure.
Code:
boolean advReturn = adv1(loc, -1, option);
which, within KoLmafia itself:
Code:
KoLmafia.makeRequest(adventure, 1);
So, LX_acquireEpicWeapon seems to assume it will get the choice option in a single adventure? Maybe you need to call it multiple times - or LX_NemesisQuest, which calls this - until it completes?
This is obviously not "finished". I assume you have private autoscend code to do that and are running into problems.
Assume the single adventure that adv1 finds is, in fact, the choice adventure.
adv1 -> KoLmafia.makeRequest -> KoLAdventure.run() -> GenericRequest.run()
The request redirects to choice.php&forceoption=0
Code:
if (this.redirectLocation.startsWith("choice.php")) {
...
this.redirectHandled = true;
ChoiceManager.processRedirectedChoiceAdventure(this.redirectLocation);
return true;
}
So here, finally, we get into ChoiceManager auto-processing the choice.
That goes to
Code:
ChoiceManager.processChoiceAdventure(ChoiceManager.CHOICE_HANDLER, redirectLocation, null);
(i.e., handle it in the special CHOICE_HANDLER request with a URL and no responseText)
That method runs the redirected URL and gets the responseText.
In particular, the response that shows our first look at the Tomb of the Unknown Your Class Here? choice.
And it automates from there on.
Now, in order to reproduce this without automating the adventure, I can just adventure in Relay Browser until I see that adventure.
Which is to say, what I am seeing is the exact same text that ChoiceManager got by submitting the choice.php?forceoption=0 URL.
*** When I break the prism and start the Nemesis Quest, I will turn on debug logging in the Unquiet Garves.
*** I will save the HTML. I should be able to write a unit test that loads that HTML and digs into how ChoiceManager deals with it.
What happens if I hit the "auto" button when I look at that page?
The browser submits "choice.php?action=auto".
RelayAgent gets that and calls:
ChoiceManager.processChoiceAdventure(this.request, "choice.php", ChoiceManager.lastResponseText)
Which is to say, the exact same method submitted by auto-adventuring, but with the responseText already obtained.
Which tells me that KoLmafia's automation of the choice will go through identical code, whether the choice is submitted by auto-adventuring or by me hitting the "auto" button in the Relay Browser.
Which also tells me that the HTML I save for seeing that choice adventure is EXACTLY what I will need for writing a unit test to see if KoLmafia comes up with the "correct" option to submit for this choice.
-----
The main question is: my analysis of what autoscend is doing is through looking at the currently released code for that script.
You told me that it submitted run_choice(-1) when it sees the choice adventure.
The code that I studied does no such thing.
Can you please show me your (modified) autoscend code that adventures until it sees the choice and then automates it with run_choice(-1)?
Thank you.