Bug - Fixed Quests - Hedge Maze ended early

Terion

Member
[r16485]

The Quests menu option for Hedge Maze (Chihuahua Herd & Kiwi) decided it was done after only going halfway and beating the Herd.

I initially used the menu option right after clearing the contests; since I hadn't actually opened the hedge maze yet, it failed. When using it again after meeting Frank, it went as far as the Herd and then decided it was done:

Code:
Tower: Contest Booth
Claiming your prize
You acquire an item: World's Best Adventurer sash
[color=red]You haven't reached the Hedge Maze yet.[/color]

Tower: Closing Ceremony
Encounter: Closing Ceremony
Encounter: Meet Frank
Encounter: Meet Frank
You are currently in room 0 and it will take you 7 turns to clear the maze.
Casting Cannelloni Cocoon 1 times...
You gain 735 hit points
Cannelloni Cocoon was successfully cast.
Entering the Hedge Maze...

[928] The Hedge Maze (Room 1)
Encounter: 'Allo

[929] The Hedge Maze (Room 2)
Encounter: One Small Step For Adventurer
You acquire an item: topiary nugglet

[930] The Hedge Maze (Room 3)
Encounter: Twisty Little Passages, All Hedge
You acquire an item: topiary nugglet
Encounter: topiary chihuahua herd
Strategy: C:\Documents and Settings\Jon\My Documents\KoLMafia Terion\ccs\Delevel and attack.ccs [default]
Round 0: Terion wins initiative!
Round 1: Terion executes a macro!
Round 1: Terion casts CURSE OF WEAKSAUCE!
Round 2: topiary chihuahua herd drops 9 attack power.
Round 2: topiary chihuahua herd drops 9 defense.
Round 2: Terion casts ENTANGLING NOODLES!
Round 3: topiary chihuahua herd drops 10 attack power.
Round 3: topiary chihuahua herd drops 8 defense.
Round 3: topiary chihuahua herd drops 10 attack power.
Round 3: topiary chihuahua herd drops 9 defense.
Round 3: Terion attacks!
Round 4: topiary chihuahua herd takes 292 damage.
Round 4: Sirius floats behind your opponent, and begins to glow brightly. Starlight shines through your opponent, doing 11 damage, and pours into your body.
Round 4: topiary chihuahua herd takes 11 damage.
Round 4: You gain 11 Mojo Points
Round 4: topiary chihuahua herd drops 9 attack power.
Round 4: topiary chihuahua herd drops 12 defense.
Round 4: Terion wins the fight!
After Battle: A love dragonfly buzzes softly in your ear.
After Battle: You gain 6 Cheek
After Battle: You gain 17 Strengthliness
After Battle: You gain 17 Enchantedness
After Battle: You gain 41 Sarcasm
Hedge Maze cleared!

I then went to the Main Map in the relay browser, which redirected to the point I was at in the hedge maze:

Code:
[931] The Hedge Maze (Room 5)
Encounter: Good Ol' 44% Duck

at which point I selected the Herd & Kiwi choice from the Quests menu again.

Code:
[931] The Hedge Maze (Room 5)
Encounter: Good Ol' 44% Duck

[932] The Hedge Maze (Room 6)
Encounter: Another Day, Another Fork
You acquire an item: topiary nugglet
Encounter: topiary kiwi
Strategy: C:\Documents and Settings\Jon\My Documents\KoLMafia Terion\ccs\Delevel and attack.ccs [default]
Round 0: Terion wins initiative!
Round 1: Terion executes a macro!
Round 1: Terion casts CURSE OF WEAKSAUCE!
Round 2: Sirius floats behind your opponent, and begins to glow brightly. Starlight shines through your opponent, doing 9 damage, and pours into your body.
Round 2: topiary kiwi takes 9 damage.
Round 2: You gain 9 Mojo Points
Round 2: topiary kiwi drops 13 attack power.
Round 2: topiary kiwi drops 13 defense.
Round 2: Terion casts ENTANGLING NOODLES!
Round 3: topiary kiwi drops 8 attack power.
Round 3: topiary kiwi drops 10 defense.
Round 3: Sirius floats behind your opponent, and begins to glow brightly. Starlight shines through your opponent, doing 8 damage, and pours into your body.
Round 3: topiary kiwi takes 8 damage.
Round 3: You gain 8 Mojo Points
Round 3: topiary kiwi drops 13 attack power.
Round 3: topiary kiwi drops 13 defense.
Round 3: Terion attacks!
Round 4: topiary kiwi takes 268 damage.
Round 4: Sirius floats behind your opponent, and begins to glow brightly. Starlight shines through your opponent, doing 10 damage, and pours into your body.
Round 4: topiary kiwi takes 10 damage.
Round 4: You gain 10 Mojo Points
Round 4: topiary kiwi drops 13 attack power.
Round 4: topiary kiwi drops 13 defense.
Round 4: Terion attacks!
Round 5: topiary kiwi takes 271 damage.
Round 5: topiary kiwi drops 13 attack power.
Round 5: topiary kiwi drops 11 defense.
Round 5: Terion wins the fight!
After Battle: You gain 19 Muscleboundness
After Battle: You gain 21 Enchantedness
After Battle: You gain 61 Roguishness
You gain a Moxie point!
[color=red]You haven't reached the Hedge Maze yet.[/color]

No idea why, after the battle with the kiwi, it felt I hadn't reached the Maze yet? Going back to the Main Mat in the relay browser brought up my current location, The Last Temptation, and I again picked the Herd/Kiwi menu option:

Code:
[933] The Hedge Maze (Room 8)
Encounter: The Last Temptation

[934] The Hedge Maze (Room 9)
Encounter: Mazel Tov!
You acquire an item: topiary nugglet
[color=red]You have already completed the Hedge Maze.[/color]

Well, I hadn't already completed the maze, but it finally was done, so I was happy. (And, using the Tower Door menu option did successfully unlock and open the door. No errors there.)
 

Veracity

Developer
Staff member
Here is the code for deciding if you are ready to go into the maze:

Code:
		String status = Preferences.getString( Quest.FINAL.getPref() );
		if ( !status.equals( "step4" ) )
		{
			String message =
				status.equals( QuestDatabase.UNSTARTED ) ?
				"You haven't been given the quest to fight the Sorceress!" :
				QuestDatabase.isQuestLaterThan( status, "step4" ) ?
				"You have already completed the Hedge Maze." :
				"You haven't reached the Hedge Maze yet.";

			KoLmafia.updateDisplay( MafiaState.ERROR, message );
			return;
		}
If "questL13Final" is "step4", the hedge maze is available.
If it is "unstarted", then "You haven't been given the quest to fight the Sorceress!"
If it is already past "step4", then "You have already completed the Hedge Maze"
Otherwise, "You haven't reached the Hedge Maze yet."

So, when you restarted the script, that setting was ... something ... that was not "step4" (or greater) and was not "unstarted".

Here is the code to iterate through the hedge maze:

Code:
		while ( status.equals( "step4" ) )
		{
			GenericRequest request = new PlaceRequest( "nstower", "ns_03_hedgemaze" );
			RequestThread.postRequest( request );

			if ( !KoLmafia.permitsContinue() )
			{
				// Presumably, we got beaten up by a fight or
				// trap, and an error message was displayed.
				return;
			}

			// *** If we won a fight, will we redirect into the choice?

			// *** What if we ran out of turns?
			if ( request.responseText.contains( "You don't have time" ) )
			{
				KoLmafia.updateDisplay( MafiaState.ERROR, "You're out of adventures." );
				return;
			}

			status = Preferences.getString( Quest.FINAL.getPref() );
		}

		KoLmafia.updateDisplay( "Hedge Maze cleared!" );
When you fought the chihuahuas, the setting was "step4".
When you beat them, the setting was something other than "step4".
When you tried to restart and it said "You haven't reached the Hedge Maze yet", that also says that it was not "step4" - or something later.

This has never, ever, behaved like this for me. Of course, I always use the "traps" path, since that is easy and uses less turns, but I'll try a "fight" path like this one next time I ascend - which will be in January, when they roll out the new Standard rewards.

In the mean time, I'll change the logging at the end of the loop to say "Hedge Maze cleared!" only if the step is "step5", and otherwise to log the unexpected setting. Perhaps you (or someone) will report the result, if it happens again.
 

Terion

Member
I always use the "traps" path, since that is easy and uses less turns,

Absolutely; I am just missing some of the factoids, and was taking the path to collect them. I'm only at 2/3 so I'll be doing them again next run. (Which could still be a week or so until I get to them, as Real Life is not letting me spend the time I'd like on KoL, but certainly before January.)

What logging should I do before I face them next time? Just "debug on" before I do the maze menu option and "debug off" when I am done? (And making sure I download the very most recent build before I attempt it, of course.)
 

Veracity

Developer
Staff member
That's right.

- Run the latest build.
- "debug on" before you start the script and "debug off" when you finish
- It wouldn't hurt to say "get questL13Final" if it errors out - although the latest build should print any unexpected value.
- If you want to restart the script, "set questL13Final=step4" SHOULD let it pick up where it left off. For that matter, visiting the tower in relay browser and going to the courtyard where you can see the maze should reset the setting to that value.

If it fails, hopefully the DEBUG log will let me figure out what happened.
 

Terion

Member
Of course, it decided to work now that it was being watched.

With the latest version, r16536, I set debug on and then did the same steps as before (though I did have a different combat macro set as my autoattack), trying the quest menu option after getting the sash (which failed, as it should have) and then meeting Frank and doing the quest option again. Ran right through the maze without error.

So, whatever caused it, it's not persistent. I've attached the debug log anyway, for kicks and giggles.
 

Attachments

  • DEBUG_20151216.txt
    635.7 KB · Views: 54

Veracity

Developer
Staff member
Code:
[color=green]> debug on[/color]

[color=green]> get questL13Final[/color]

step4
You are currently in room 0 and it will take you 7 turns to clear the maze.
Entering the Hedge Maze...

[947] The Hedge Maze (Room 1)
Encounter: 'Allo

[948] The Hedge Maze (Room 2)
Encounter: One Small Step For Adventurer
You acquire an item: topiary nugglet

[949] The Hedge Maze (Room 3)
Encounter: Twisty Little Passages, All Hedge
You acquire an item: topiary nugglet
Encounter: topiary chihuahua herd
Strategy: skill saucegeyser
Round 0: Veracity wins initiative!
Round 1: Veracity executes a macro!
Round 1: Veracity casts SAUCEGEYSER!
Round 2: topiary chihuahua herd takes 188 damage.
Round 2: Thct'ul Grrl caresses your mind with gentle ethereal tentacles.
Round 2: You gain 10 Mana Points
Round 2: topiary chihuahua herd takes 17 damage.
Round 2: Tubert runs in circles around your opponent, tangling them up in the nasty child leash and dealing 4 damage.
Round 2: topiary chihuahua herd takes 4 damage.
Round 2: Veracity casts SAUCEGEYSER!
Round 3: topiary chihuahua herd takes 188 damage.
Round 3: Thct'ul Grrl caresses your mind with gentle ethereal tentacles.
Round 3: You gain 12 Mana Points
Round 3: Tubert runs in circles around your opponent, tangling them up in the nasty child leash and dealing 3 damage.
Round 3: topiary chihuahua herd takes 3 damage.
Round 3: Veracity wins the fight!
After Battle: A love firefly flits flirtatiously around your head.
After Battle: You gain 6 Wizardliness
After Battle: Thct'ul Grrl surveys the scene from your back, and gains 1 Experience.
After Battle: Tubert grins wildly at you while explaining the ancient Druidic origins of the Crimbo holiday. (+8 Stats)
After Battle: You gain 22 Muscleboundness
You gain a Muscle point!
After Battle: You gain 41 Wizardliness
After Battle: You gain 19 Cheek
You gain a Moxie point!
Hedge Maze not complete. Unexpected quest status: questL13Final = step2

[color=green]> debug off[/color]
Fascinating.
 

Veracity

Developer
Staff member
Ha ha.

Code:
		String adventureId = KoLAdventure.lastAdventureIdString();
		String counter =
			adventureId.equals( "ns_01_crowd1" ) ?
			"nsContestants1" :
			adventureId.equals( "ns_01_crowd2" ) ?
			"nsContestants2" :
			adventureId.equals( "ns_01_crowd3" ) ?
			"nsContestants3" :
			null;

		if ( counter != null )
		{
			int crowd = Preferences.getInteger( counter );
			if ( crowd > 0 )
			{
				Preferences.setInteger( counter, crowd - 1 );
			}
			if ( Preferences.getInteger( "nsContestants1" ) == 0 &&
			     Preferences.getInteger( "nsContestants2" ) == 0 &&
			     Preferences.getInteger( "nsContestants3" ) == 0 )
			{
				QuestDatabase.setQuestProgress( Quest.FINAL, "step2" );
			}
			return;
		}
This is called after a fight. Apparently, once you've fought one of the crows, your lastAdventureId will say so, but proceeding into the hedge maze does not reset it. Looking at the DEBUG log, I see that we requested

place.php?whichplace=nstower&action=ns_03_hedgemaze

which redirected to

choice.php?forceoption=0

and when we requested that and visited the location, we logged it as

[947] The Hedge Maze (Room 1)
Encounter: 'Allo

We should probably set the last location to be the hedge maze for any of the hedge maze choices.
 

Veracity

Developer
Staff member
Revision 16587 should set your location & quest progress appropriately when you visit a room in the hedge maze.

I tried proceeding with the script after making that change, but, since I was in the middle of logging in, it did not work all that well; it kept trying to continue logging in after a fight or choice step continued.

That is probably a bug; it should wait until the entire fight/choice chain is complete before doing that. I might look at that, eventually, although it's a rare situation. I'll see if I can find an easier (not once per ascension) choice/fight chain to logout/login in the middle of.

I'lll leave this "Waiting for Info" in case you (or somebody) tries this script again before I get there. Which will be a few days; I'm not likely to ascend until I get the seasonal PVP reward, which will take another three days, probably.
 

Terion

Member
Just downloaded r16607, logged in, and ran the Gopher & Duck option, and then realized I forgot to turn on debug. FWIW, the quest menu choice worked fine:
Code:
You are currently in room 0 and it will take you 7 turns to clear the maze.
Casting Cannelloni Cocoon 1 times...
You gain 166 hit points
Cannelloni Cocoon was successfully cast.
Entering the Hedge Maze...

[969] The Hedge Maze (Room 1)
Encounter: 'Allo

[970] The Hedge Maze (Room 2)
Encounter: One Small Step For Adventurer
You acquire an item: topiary nugglet
Encounter: topiary gopher
Strategy: skill cannelloni cannon
Round 0: Terion wins initiative!
Round 1: Terion executes a macro!
Round 1: Terion casts CANNELLONI CANNON!
Round 2: topiary gopher takes 72 damage.
Round 2: topiary gopher takes 21 damage.
Round 2: Terion casts CANNELLONI CANNON!
Round 3: topiary gopher takes 72 damage.
Round 3: Terion casts CANNELLONI CANNON!
Round 4: topiary gopher takes 72 damage.
Round 4: Terion casts CANNELLONI CANNON!
Round 5: topiary gopher takes 72 damage.
Round 5: Terion wins the fight!
After Battle: A love stag beetle brushes up against your ankle affectionately.
After Battle: You gain 4 Beefiness
After Battle: Dupdep spins and whirls in the breeze, like a spicy little dust devil.
After Battle: Gatchell grins wildly and sings "It's the mooost mystical tiiiiiiime of the yeeeeaaaaarrr!" (+8 Stats)
After Battle: You gain 15 Strengthliness
After Battle: You gain 50 Magicalness
After Battle: You gain 19 Smarm

[971] The Hedge Maze (Room 4)
Encounter: Pooling Your Resources

[972] The Hedge Maze (Room 5)
Encounter: Good Ol' 44% Duck
You acquire an item: topiary nugglet
Encounter: topiary duck
Strategy: skill cannelloni cannon
Round 0: Terion loses initiative!
Round 1: You lose 21 hit points
Round 1: Terion executes a macro!
Round 1: Terion casts CANNELLONI CANNON!
Round 2: topiary duck takes 72 damage.
Round 2: topiary duck takes 20 damage.
Round 2: You lose 22 hit points
Round 2: Terion casts CANNELLONI CANNON!
Round 3: topiary duck takes 72 damage.
Round 3: You lose 23 hit points
Round 3: Terion casts CANNELLONI CANNON!
Round 4: topiary duck takes 72 damage.
Round 4: You lose 19 hit points
Round 4: Terion casts CANNELLONI CANNON!
Round 5: topiary duck takes 72 damage.
Round 5: You lose 22 hit points
Round 5: Terion casts CANNELLONI CANNON!
Round 6: topiary duck takes 72 damage.
Round 6: Terion wins the fight!
After Battle: Dupdep whirls around picking up items, like a little couscous tornado.
After Battle: Gatchell grins wildly and sings "It's the mooost mystical tiiiiiiime of the yeeeeaaaaarrr!" (+8 Stats)
After Battle: You gain 21 Muscleboundness
After Battle: You gain 68 Wizardliness
You gain a Mysticality point!
After Battle: You gain 22 Chutzpah

[973] The Hedge Maze (Room 7)
Encounter: Of Mouseholes and Manholes

[974] The Hedge Maze (Room 8)
Encounter: The Last Temptation
You acquire an item: topiary nugglet

[975] The Hedge Maze (Room 9)
Encounter: Mazel Tov!
You acquire an item: topiary nugglet
Hedge Maze cleared!
 

Veracity

Developer
Staff member
This is fixed, then.

I ran the Chihuahua and Kiwi option today, but it aborted the combat for no reason I could understand. I changed my Attack Option from Custom to Attack with Weapon and restarted it, and it worked fine.
 
Top