Bug - Fixed "dvorak" command does not show final response

Veracity

Developer
Staff member
The "dvorak" command is a "specialCommand" used to solve the tile puzzle in the Hidden Temple. (It's called that for historical reasons; even though the puzzle is now the second of three scripted steps and is called "Beginning at the Beginning of Beginning", back when it was a random encounter, it was called "Dvorak's Revenge".)

The "Solve" button that we provide for this puzzle submits this URL: "/KoLmafia/specialCommand?cmd=dvorak&pwd=xxx".

The RelayRequest treats a "specialCommand" as sort of like an internal relay script: it calls a CLI command (by submitting it to the Command Queue) which submits an arbitrary series of requests.

While it is executing, it will periodically refresh the browser window with a page that says "Automating (see CLI for details, click to refresh)..."

When the command is done, it sets up RelayRequest.specialCommandResponse with the response text that will be sent down to the browser.

Meanwhile, the browser is periodically refreshing with "/KoLmafia/specialCommand?cmd=wait&pwd=xxx". When that is submitted and the Command Queue is empty, it sents down RelayRequest.specialCommandResponse. If the command did not set up a response, it loads a page that simply says "Automation complete.".

This used to work flawlessly; we'd see the "Automating" page, and when the dvorak puzzle was complete, we'd see the next page, "No Visible Means of Support", complete with the comment "You jump to the last letter, and put your pom-poms down with a sigh of relief -- thank goodness that's over. ".

I just ran this today, and when it was done, KoLmafia showed me a page that said "Automation complete.)" I was running with debugging, and I see the following:

Retrieved: http://www.kingdomofloathing.com/choice.php?forceoption=0
Retrieving server reply
ResponseText has 9003 characters.

Code:
<html><head>...</head><body><Center><centeR><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>No Visible Means of Support</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><center><img src="http://images.kingdomofloathing.com/adventureimages/beams.gif" width=100 height=100></center><p>You jump to the last letter, and put your pom-poms down with a sigh of relief -- thank goodness that's over. Worst. Spelling bee. Ever.  Past the tiles, a corridor continues even deeper into the temple.  You follow it into another room.<p>The intricately vaulted ceiling of this chamber is supported by a series of ancient wooden beams. Unfortunately, it appears that the masonry hasn't entirely stood the test of time, as you feel water drip from a leak in the ceiling and splash on your head.<p>Wait -- <i>sniff, sniff</i> -- that's not water, it's oil! You run for the exit, only to discover that it has been sealed shut behind you. Rivers of oil now pour down the wooden supports, and with a WHOOSH the entire roof bursts into flames. The stonework starts to crumble and fall...<center><form name=choiceform1 action=choice.php method=post><input type=hidden name=pwd value='8f68520ddd9c613d700e7920d354175d'><input type=hidden name=whichchoice value=125><input type=hidden name=option value=1><input class=button type=submit value="Run around in a mad panic"></form><form name=choiceform2 action=choice.php method=post><input type=hidden name=pwd value='8f68520ddd9c613d700e7920d354175d'><input type=hidden name=whichchoice value=125><input type=hidden name=option value=2><input class=button type=submit value="Attempt to douse the flames"></form><form name=choiceform3 action=choice.php method=post><input type=hidden name=pwd value='8f68520ddd9c613d700e7920d354175d'><input type=hidden name=whichchoice value=125><input type=hidden name=option value=3><input class=button type=submit value="Do nothing"></form></center></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center><script>top.charpane.location.href="charpane.php";</script></body></html>
Encounter: No Visible Means of Support
Processing results...

and then:

Requesting: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieving server reply
ResponseText has 2941 characters.
...api.php response...

Processing result: Advs Used: -1
What's that spell? BANANAS!
Tile puzzle completed.

Sure enough, the gCLI and session log showed the expected:

Encounter: Beginning at the Beginning of Beginning
Give me a B!
tiles.php?action=jump&whichtile=4
Give me an A!
tiles.php?action=jump&whichtile=6
Give me an N!
tiles.php?action=jump&whichtile=3
Give me an A!
tiles.php?action=jump&whichtile=5
Give me an N!
tiles.php?action=jump&whichtile=7
Give me an A!
tiles.php?action=jump&whichtile=6
Give me an S!
tiles.php?action=jump&whichtile=3
Encounter: No Visible Means of Support
What's that spell? BANANAS!
Tile puzzle complete.
Encounter: No Visible Means of Support
(Yes, the cheerleader simulation is new silliness I added in response to the comment about pom-poms.)

What does the solver do?

Code:
		KoLmafia.updateDisplay( "Tile puzzle completed." );

		StringBuffer buffer = new StringBuffer( request.responseText );
		RequestEditorKit.getFeatureRichHTML( request.getURLString(), buffer );
		RelayRequest.specialCommandResponse = buffer.toString();
		RelayRequest.specialCommandIsAdventure = true;
		DvorakDecorator.lastResponse = null;
That is not new. What IS new is that specialCommandResponse was, apparently, "" when it came time to respond to the "wait" command.
 
Last edited:

Veracity

Developer
Staff member
Thank you. This appears to be the same bug as I reported with the "volcano solve" command; Eclipse shows that it really is executing the solution, but it's not displaying the final screen.
 

Veracity

Developer
Staff member
Let me guess: you are pulling the command off of the CommandQueue before it is done executing.
 

roippi

Developer
Yup. r14757, untested

(rather, r14758, now that I've remembered how to boolean logic)
 
Last edited:

Veracity

Developer
Staff member
Tested 14758 with volcano solve command (invoked by Relay Browser "solve" command) - and it worked.
Marking this fixed.
 
Top