Bug - Fixed Infinite loop inside a choice adventure in the Top Floor of the Castle

Top Goth was set to Complete Quest.
So was Top Punk Rock.
Top Raver was set to get the record.
Top Steampunk was set to complete quest (with airship).

This is from my session log:
[582] The Castle in the Clouds in the Sky (Top Floor)
Encounter: Yeah, You're for Me, Punk Rock Giant
Took choice 678/3:
choice.php?whichchoice=678&option=3&pwd
Encounter: Yeah, You're for Me, Punk Rock Giant
Took choice 678/3:
choice.php?whichchoice=678&option=3&pwd
Encounter: Yeah, You're for Me, Punk Rock Giant
Took choice 678/3:
choice.php?whichchoice=678&option=3&pwd
Encounter: Yeah, You're for Me, Punk Rock Giant
Took choice 678/3:
choice.php?whichchoice=678&option=3&pwd
(last 3 lines are repeated again and again endlessly)

Pressing Escape won't get KoLmafia out of this loop, nor will telling it to stop now. Only quitting it works (and even then, I had to log into vanilla KoL to get out of the choice adventure KoLmafia got stuck in).
The garbage quest wasn't completed at this point, and I did NOT have a model airship in my inventory at the time either.
 
Last edited by a moderator:

Crowther

Active member
Pressing Escape won't get KoLmafia out of this loop, nor will telling it to stop now. Only quitting it works (and even then, I had to log into vanilla KoL to get out of the choice adventure KoLmafia got stuck in).
The garbage quest wasn't completed at this point, and I did NOT have a model airship in my inventory at the time either.
You can also complete the choice in the relay browser, while KoLmafia is looping to break out.
 

Darzil

Developer
Unfortunately there currently a number of choice adventures where you can choose something impossible, and this is one. Option 3 doesn't always exist, and if so Kolmafia will get stuck.
 
The sensible thing to do in this situation, since KoLmafia doesn't know what else to do, is abort - it can't second-guess what you meant if choice #3 doesn't exist.
 

Darzil

Developer
The sensible thing to do in this situation, since KoLmafia doesn't know what else to do, is abort - it can't second-guess what you meant if choice #3 doesn't exist.

It may not be as straightforward as this appears. KoLmafia does not currently parse the text looking for which options are displayed other than in the Relay Browser and only then if relayShowSpoilers is true.

So this would be asking to add parsing for all non-combats with automation, adding extra time to all non-combats for everyone to see if any match the choice you've chosen, and if not to abort.
 

Veracity

Developer
Staff member
I don't think that's true. There is a method - ChoiceManager.specialChoiceDecision - which is called during automation to decide which option to take. That has access to the responseText and can see if the chosen choice is available, and change it to something else if not. For example, the "Duffel on the Double" adventure on the eXtreme slope may or may not let you get the jar of frostigkraut.

Code:
		// Duffel on the Double
		case 575:
			// Option 2 - "Dig deeper" - is not always available.
			if ( decision.equals( "2" ) && !responseText.contains( "Dig deeper" ) )
			{
				return "3";
			}
			return decision;
 

Darzil

Developer
Oh, can certainly add it to that one. Was more commenting on generically checking for all choice adventures if the value in choiceAdventureXXX in case the user has selected something incorrect.

r12651
 
Top