Bug - Fixed Leprecondo only parses when you visit the URL for the first time, not when you submit a choice. Also, doesn't report handlingChoice?

phreddrickk

Member
Here are some snippets from the CLI:
> js use(Item.get("Leprecondo")); handlingChoice();

Using 1 Leprecondo...
Encounter: Heimdall's Footstool's Condo
Finished using 1 Leprecondo.
Returned: false

> js visitUrl(`inv_use.php?whichitem=${Item.get("Leprecondo").id}&pwd`); handlingChoice();

Encounter: Heimdall's Footstool's Condo
Returned: false
Here, neither "use" or directly visiting inv_use.php resulted in handlingChoice returning true, despite displaying the encounter name in the CLI. Maybe this is because it's an escapable choice? But with the autumn-aton, I can get handlingChoice to return true:
> js visitUrl(`inv_use.php?whichitem=${Item.get("Autumn-Aton").id}&pwd`); handlingChoice();

Returned: true
Then there's the matter of this:
> js use(Item.get("Leprecondo")); visitUrl("choice.php?whichchoice=1556&pwd&option=1&r3=27&r2+13&r1=5&r0=22"); getProperty("leprecondoInstalled");

Using 1 Leprecondo...
Encounter: Heimdall's Footstool's Condo
Finished using 1 Leprecondo.
Encounter: Heimdall's Footstool's Condo
Returned: 0,0,0,0

> js use(Item.get("Leprecondo"));

Using 1 Leprecondo...
Encounter: Heimdall's Footstool's Condo
Preference leprecondoInstalled changed from 0,0,0,0 to 22,5,0,27
Finished using 1 Leprecondo.
Returned: true
When I manually completed the choice using visit_url (or do this in my browser), mafia doesn't update upon completing and exiting the choice. It only updates when I visit the choice anew for the first time again.
 
That is probably because LeprecondoManager parses the furniture by looking at the dropdowns - which are not there unless you have rearrangements left today.
I did still have rearrangements left, the pref properly updated when I re-visited the page. Although this is also an issue.
 
Here, neither "use" or directly visiting inv_use.php resulted in handlingChoice returning true, despite displaying the encounter name in the CLI. Maybe this is because it's an escapable choice? But with the autumn-aton, I can get handlingChoice to return true:
Yeah, that is a bug. ChoiceManager.stllInChoice() has a regexp which does not handle this:

<input type='hidden' name='whichchoice' value='1556' />

Heh. Sorry, I misspoke - and deleted my response, since it would not allow me to edit out that part.
LeprecondoManager does parse the images but only on a visit.

Taking a choice and staying in the choice should count as a visit - but probably as a result of the first bug, it doesn't get called again.

If you want to test the fixed regexp, do this in ChoiceManager.java

Code:
  private static Pattern STILL_IN_CHOICE =
      Pattern.compile(
          "href=\"?choice\\.php(?!>refresh</a>)|action='?choice\\.php'?|name=['\"]whichchoice['\"]");
 
Back
Top