Feature - Implemented Choice encounter confusion by non-adv.php and "walkaway" choices

Aenimus

Member
I'm not denying that I could be doing something wrong, and I'm most definitely misunderstanding something.

But I don't understand why I would receive different results doing everything the exact same EXCEPT where/whether I visit between Source Terminal and God Lobster.

Could you explain to me, in very simple terms, why it's not breaking every time? Because my understanding is that it should break every time, or break none of the time. But the choice (or lack thereof) after Source appears to dictate success or failure.
 

Veracity

Developer
Staff member
Because the Source terminal choice adventure (1191) is special

It takes whichchoice and option, like any choice, but also requires a "text" field. Here is what the "choice" command tells me if I visit the terminal in the relay browser:

Code:
> choice

[b]choice 1[/b]: (secret choice)
  text = i[b]nput[/b]
That tells me that to submit this choice, you need:

choice.php?whichchoice=1191&option=1&input=TEXT

It also has only a single option - 1 - so if you try to submit option 2, KoLmafia will fail, as you saw it, with:

Code:
Unsupported choice adventure #1191
choice 1: (secret choice)
Click here to continue in the relay browser.
 

Aenimus

Member
I submitted "2" both times.

Code:
	// God Lobster
	if (globster_can()) {
		globster_run(5, 2);
		continue;
	}

The second argument; i.e., 2, is the choice number.
 

Veracity

Developer
Staff member
Exactly. 2 is the option number. That is not a valid option for choice 1191 - the Source Terminal.
 

Aenimus

Member
OK. Fresh character. Fresh, simplified code.

Code:
script "test69420.ash";

int i = 0;
while (my_inebriety() < inebriety_limit() + 1) {
	set_property("choiceAdventure1310", 0);

	if (i == 0) {
		cli_execute("terminal educate digitize");
		cli_execute("terminal educate extract");
		// Doing the escape stuff. First God Lobster fight should be fine.
		visit_url("place.php?whichplace=town_wrong&action=townwrong_tunnel", false);
		run_choice(2);
		visit_url("main.php");
		i++;
		continue;
	}

	// God Lobster
	if (i == 1 || i == 3) {
		$familiar[God Lobster].use_familiar();
		visit_url("main.php?fightgodlobster=1");
		run_combat();
		visit_url("choice.php");
		run_choice(2);
		i++;
		continue;
	}
	
	if (i == 2) {
		cli_execute("terminal educate digitize");
		cli_execute("terminal educate extract");
		// No escape. Second God Lobster should fail.
		i++;
		continue;
	}
	
	abort("Complete.");
}

OUTCOME

Code:
> test69420.ash

Source Terminal: educate digitize.edu
Preference sourceTerminalEducate1 changed from extract.edu to digitize.edu
Source Terminal used.
Source Terminal: educate extract.edu
Preference sourceTerminalEducate1 changed from digitize.edu to extract.edu
Source Terminal used.
Preference lastAdventure changed from None to The Tunnel of L.O.V.E.
Preference nextAdventure changed from None to The Tunnel of L.O.V.E.

[2144] The Tunnel of L.O.V.E.
Preference lastEncounter changed from Granted a Boon (#1310) to The Tunnel of L.O.V.E. (#1222)
Encounter: The Tunnel of L.O.V.E. (#1222)
Submitting option 2 for choice 1222
Preference _godLobsterFights changed from 0 to 1
Preference lastAdventure changed from The Tunnel of L.O.V.E. to None
Preference nextAdventure changed from The Tunnel of L.O.V.E. to None

[2144] God Lobster
Preference lastEncounter changed from The Tunnel of L.O.V.E. (#1222) to the God Lobster
...
This combat did not cost a turn

[2144] God Lobster
Preference lastEncounter changed from the God Lobster to Granted a Boon (#1310)
Encounter: Granted a Boon (#1310)
Submitting option 2 for choice 1310
Encounter: Granted a Boon (#1310)
You gain 625 Strongness
You gain 625 Mysteriousness
You gain 675 Smarm
You acquire an item: Dish of Clarified Butter
Source Terminal: educate digitize.edu
Preference sourceTerminalEducate1 changed from extract.edu to digitize.edu
Source Terminal used.
Source Terminal: educate extract.edu
Preference sourceTerminalEducate1 changed from digitize.edu to extract.edu
Source Terminal used.
Preference _godLobsterFights changed from 1 to 2

[2144] God Lobster
Preference lastEncounter changed from Granted a Boon (#1310) to the God Lobster
...
This combat did not cost a turn
Unsupported choice adventure #1191
choice 1: (secret choice)
Click here to continue in the relay browser.

You're on your own, partner.
 

Aenimus

Member
OK, now I think I understand. Lyle option 2 is illegal, so it breaks. Source Terminal option 2 is illegal, so it breaks. Love tunnel option 2 is not illegal, so it doesn't break.

The part I still don't understand is why my visit to choice.php is not happening?
 

Veracity

Developer
Staff member
Because you submitted it via GET (the "false" second argument) when KoL requires a POST (a "true" - or omitted - second argument),
 

Aenimus

Member
Not in the example I just provided. But the same thing happened?

EDIT: Looks like I put a false in the LOVE Tunnel visit. But that didn't fail. The subsequent attempt (no Love Tunnel stuff) failed.
 

Aenimus

Member
Fresh account. I removed the false from the LOVE Tunnel visit. First Lobster fight works; second fails.

No falses anywhere in sight.
 

Aenimus

Member
Code:
script "test69420.ash";

int i = 0;
while (my_inebriety() < inebriety_limit() + 1) {
	set_property("choiceAdventure1310", 0);

	if (i == 0) {
		cli_execute("terminal educate digitize");
		cli_execute("terminal educate extract");
		// Doing the escape stuff. First God Lobster fight should be fine.
		visit_url("place.php?whichplace=town_wrong&action=townwrong_tunnel");
		run_choice(2);
		visit_url("main.php");
		i++;
		continue;
	}

	// God Lobster
	if (i == 1 || i == 3) {
		$familiar[God Lobster].use_familiar();
		visit_url("main.php?fightgodlobster=1");
		run_combat();
		visit_url("choice.php");
		run_choice(2);
		i++;
		continue;
	}
	
	if (i == 2) {
		cli_execute("terminal educate digitize");
		cli_execute("terminal educate extract");
		// No escape. Second God Lobster should fail.
		i++;
		continue;
	}
	
	abort("Complete.");
}

Code:
> test69420.ash

Source Terminal: educate digitize.edu
Preference sourceTerminalEducate1 changed from extract.edu to digitize.edu
Source Terminal used.
Source Terminal: educate extract.edu
Preference sourceTerminalEducate1 changed from digitize.edu to extract.edu
Source Terminal used.
Preference lastAdventure changed from None to The Tunnel of L.O.V.E.
Preference nextAdventure changed from None to The Tunnel of L.O.V.E.

[10382] The Tunnel of L.O.V.E.
Preference lastEncounter changed from Granted a Boon (#1310) to The Tunnel of L.O.V.E. (#1222)
Encounter: The Tunnel of L.O.V.E. (#1222)
Submitting option 2 for choice 1222
Preference _godLobsterFights changed from 0 to 1
Preference lastAdventure changed from The Tunnel of L.O.V.E. to None
Preference nextAdventure changed from The Tunnel of L.O.V.E. to None

[10382] God Lobster
Preference lastEncounter changed from The Tunnel of L.O.V.E. (#1222) to the God Lobster
Encounter: the God Lobster
...
This combat did not cost a turn

[10382] God Lobster
Preference lastEncounter changed from the God Lobster to Granted a Boon (#1310)
Encounter: Granted a Boon (#1310)
Submitting option 2 for choice 1310
Encounter: Granted a Boon (#1310)
You gain 675 Strongness
You gain 625 Wizardliness
You gain 625 Chutzpah
You acquire an item: Dish of Clarified Butter
Source Terminal: educate digitize.edu
Preference sourceTerminalEducate1 changed from extract.edu to digitize.edu
Source Terminal used.
Source Terminal: educate extract.edu
Preference sourceTerminalEducate1 changed from digitize.edu to extract.edu
Source Terminal used.
Preference _godLobsterFights changed from 1 to 2

[10382] God Lobster
Preference lastEncounter changed from Granted a Boon (#1310) to the God Lobster
Encounter: the God Lobster
...
This combat did not cost a turn
Unsupported choice adventure #1191
choice 1: (secret choice)
Click here to continue in the relay browser.
 

Aenimus

Member
Yes.

Code:
After Battle: You gain 7 Magicalness
After Battle: You gain 238 Strengthliness
After Battle: You gain 117 Mysteriousness
After Battle: You gain 135 Smarm
This combat did not cost a turn
Unsupported choice adventure #1191
choice 1: (secret choice)
Click here to continue in the relay browser.

At this point I agree that it's something to do with visiting choice.php. My question is why it's not visiting choice.php.
 

Veracity

Developer
Staff member
Well, I'm clueless. My test script - globster-test.ash - posted above never "escapes" from the Source Terminal and it works every single time.
I'll try your script tomorrow.
 

Aenimus

Member
I think I've got it. if I change run_combat() to $skill[Saucegeyser].use_skill(), it works flawlessly no matter what (it hits choice.php fine).

But if I use run_combat(), it doesn't hit choice.php; and then obviously just submits 2, which only works if 2 is an available option in the last choice (e.g., Love Tunnel but not Source Terminal or Lyle).

I checked out my combat consult script--lo and behold, I've not been handling choice_follows_fight() for God Lobster. The combat consult script only handles LOVE Tunnel combats. Consequently, it was never ever hitting choice.php ever.

I'm sorry to have wasted your time.
 
Last edited:

Veracity

Developer
Staff member
Don't worry about it. I added handling_choice() and improved run_choice() in ASH, which should make everybody's life easier henceforth.
 

Malibu Stacey

Active member
I'll try that out.

Assuming that I can come up with a monster in such a location that gives you a choice adventure when you defeat it; that is the only situation in which choice_follows_fight() is meaningful.

Spookyraven Bedroom immediately comes to mind however you can also get the same effect from the Lil' Doctor™ bag quest and using the Fourth of May Cosplay Saber skill (those last 2 are the ones causing me issues and Spookyraven Bedroom has been a problem for autoscend).
 
Last edited:

Veracity

Developer
Staff member
Spookyraven Bedroom immediately comes to mind.
Thanks! A non-IOTM solution means that any of my test multis can experiment with this.
(I confess that it did not "immediately come to mind", although it does seem obvious now that YOUR mind has been put to bear upon it. :) )

My guess is that "adv1" counts as automating and maybe it goes a little too far, but this will take experimentation in order to understand what the issue is.
 

Veracity

Developer
Staff member
I'm not seeing any problems. I did not pass a well formed "filter function" to adv1(), but it fell through to use my CCS, which worked in the fight.
Edit: I tried the same thing with adventure( 1, $location[ The Haunted Bedroom ] ) and it also worked fine.

Code:
[color=green]> ashq adv1( $location[ The Haunted Bedroom ], 1, "skill saucegeyser" )[/color]

Visit to Manor2: The Haunted Bedroom in progress...

[839444] The Haunted Bedroom
Encounter: animated rustic nightstand
Round 0: Tebryn wins initiative!
Macro override "skill saucegeyser" returned void.
Round 1: Tebryn executes a macro!
Round 1: Tebryn attacks!
Round 2: animated rustic nightstand takes 9814 damage.
Round 2: Wingwang shakes loose a considerable quantity of spice. You conjure up a canister and collect it.
You acquire an item: spices
Round 2: Tebryn wins the fight!
After Battle: Wingwang does an impression of a swarm of tiny bees dancing, directing each other to the items they've discovered.
After Battle: You gain 7 Muscleboundness
After Battle: You gain 12 Mysteriousness
After Battle: You gain 4 Sarcasm

Requests complete.

[color=green]> ash choice_follows_fight()[/color]

Returned: true

[color=green]> ashq visit_url( "choice.php" )[/color]

Encounter: One Rustic Nightstand

[color=green]> ash handling_choice()[/color]

Returned: true

[color=green]> choice[/color]

[b]choice 1[/b]: Check the top drawer (moxie)
[b]choice 2[/b]: Check the bottom drawer (grouchy restless spirit or empty drawer)
[b]choice 3[/b]: Investigate the jewelry (enter combat with mistress (1))
[b]choice 5[/b]: Use a ghost key (moxie substats (with ghost key))
[b]choice 6[/b]: Ignore it (skip)

[color=green]> ashq run_choice( 1 )[/color]

Submitting option 1 for choice 879
You gain 200 Chutzpah
 
Last edited:

Aenimus

Member
I know this is off-topic, but I don't think it warrants a new thread. In a combat consult script, what should I be doing after casting macrometeor for the consult script to realise it's a new monster? Visit fight.php? Sometimes it's actually useful for macrometeor to not be recognised as a new monster, however.
 

Malibu Stacey

Active member
I'm not seeing any problems. I did not pass a well formed "filter function" to adv1(), but it fell through to use my CCS, which worked in the fight.
Edit: I tried the same thing with adventure( 1, $location[ The Haunted Bedroom ] ) and it also worked fine.

Code:
[color=green]> ashq adv1( $location[ The Haunted Bedroom ], 1, "skill saucegeyser" )[/color]

Visit to Manor2: The Haunted Bedroom in progress...

[839444] The Haunted Bedroom
Encounter: animated rustic nightstand
Round 0: Tebryn wins initiative!
Macro override "skill saucegeyser" returned void.
Round 1: Tebryn executes a macro!
Round 1: Tebryn attacks!
Round 2: animated rustic nightstand takes 9814 damage.
Round 2: Wingwang shakes loose a considerable quantity of spice. You conjure up a canister and collect it.
You acquire an item: spices
Round 2: Tebryn wins the fight!
After Battle: Wingwang does an impression of a swarm of tiny bees dancing, directing each other to the items they've discovered.
After Battle: You gain 7 Muscleboundness
After Battle: You gain 12 Mysteriousness
After Battle: You gain 4 Sarcasm

Requests complete.

[color=green]> ash choice_follows_fight()[/color]

Returned: true

[color=green]> ashq visit_url( "choice.php" )[/color]

Encounter: One Rustic Nightstand

[color=green]> ash handling_choice()[/color]

Returned: true

[color=green]> choice[/color]

[b]choice 1[/b]: Check the top drawer (moxie)
[b]choice 2[/b]: Check the bottom drawer (grouchy restless spirit or empty drawer)
[b]choice 3[/b]: Investigate the jewelry (enter combat with mistress (1))
[b]choice 5[/b]: Use a ghost key (moxie substats (with ghost key))
[b]choice 6[/b]: Ignore it (skip)

[color=green]> ashq run_choice( 1 )[/color]

Submitting option 1 for choice 879
You gain 200 Chutzpah

Apologies Veracity, I haven't looked at the Haunted Bedroom stuff since I fixed the issues in autoscend a while back.

I'm awaiting a new Lil' Doctor Bag quest to re-test this (takes a few days normally as I only use sausage goblins to advance them and only when I don't have other use for them) and I think my Force Saber issue is a different problem which I'll create a new post for rather than clog this one.
 
Top