Feature - Implemented Tracking the Daily Lyle buff at the Monorail

Erich

Member
Every day you can hit up Lyle to get the "Favored by Lyle" buff at the monorail (place.php?whichplace=monorail&action=monorail_lyle). I would like to ask for a pref that tracks whether or not you nabbed it for that day.

Thank you kindly :)
 

Darzil

Developer
So I'm probably being dumb, or just haven't woken up yet, but where would we put the checks for this page?
place.php?whichplace=monorail&action=monorail_lyle redirects to choice.php?forceoption=0, but there is then no choice number in evidence.

(Other than that have a patch which does this and adds it to maximizer).
 

Veracity

Developer
Staff member
I visited in the relay browser:

https://www.kingdomofloathing.com/place.php?whichplace=monorail
https://www.kingdomofloathing.com/place.php?whichplace=monorail&action=monorail_lyle
Field: Location = [choice.php?forceoption=0]
https://www.kingdomofloathing.com/choice.php?forceoption=0
You acquire an effect: Favored by Lyle (10)

You are correct: it is handled by a redirection to a choice page, but we never get to see which one it is.

Looking at ChoiceManager, I see that we've encountered this difficulty before.

Code:
		case 1093:
		{
			// The WLF Bunker

			// The following won't work, since visiting the WLF bunker is:
			//     place.php?whichplace=airport_hot&action=airport4_questhub
			// which redirects to
			//     choice.php?forceoption=0
			// but if there is no "whichchoice" on that page, we won't know
			// to come here.

			// You enter the bunker, but the speaker is silent. You've already done your day's work, soldier!
			if ( text.contains( "the speaker is silent" ) )
Perhaps we could add something to ChoiceManager to handle "forceoption=0"pages that don't actually have a choice on the page. I see the following code in ChoiceManager.visitChoice():

Code:
	public static void visitChoice( final GenericRequest request )
	{
		String text = request.responseText;
		ChoiceManager.lastChoice = ChoiceManager.extractChoice( text );

		if ( ChoiceManager.lastChoice == 0 )
		{
			// choice.php did not offer us any choices.  This would
			// either be a bug in KoL itself or a non-choice page
			// that you can visit at any time that we don't know
			// about yet.
			return;
		}
That spot right there with the "did not offer us any choices" comment. That could call a method which would look at the response text to deduce what it can - like WLF bunker or Lyle stuff. Or, perhaps better, if we saved the place you redirect FROM, that method could look at that and do (stuff) for the WLF bunker and (stuff) for Lyle and so on.
 

Darzil

Developer
r18583 adds _lyleFavored and adds it to Maximizer.

Added the check to extractChoice, where we did for Hippy Talkin'. Also fixes visiting Bunker when it is silent (but Bunker checks aren't working after handing in for some reason). Unfortunately we still don't know what choice it is, so added the update to _lyleFavored in extractChoice, which is perhaps hacky.

Edit - bunker checks handing in worked fine for me today, so working.
 
Last edited:
Top