Recent problems with batfellow.ash

adeyke

Member
I use cheesecookie's batfellow.ash to turn my weekly special edition Batfellow comics into meat, when I'm in aftercore. However, the past two times, I encountered problems with it. I'd get frequent "Whoops! You're not actually in a choice adventure" errors that aborted the script. I'd rerun the script each time this happened, but it would eventually terminate at the Jokester due to not having defeated Kudzu, Mansquito, or Miss Graves.

I had these problems on August 2 and August 8. The last time I ran it without issue was July 25.

I'm not sure what the source of the problem is or how to fix it.
 

Ryo_Sangnoir

Developer
Staff member
In r26613, code was added to abort if a script tries to run a choice without actually being in a choice adventure.

Either we need to figure out what the script is doing and allow that case, or stop aborting on this error. Maybe with a preference.
 

Veracity

Developer
Staff member
In r26613, code was added to abort if a script tries to run a choice without actually being in a choice adventure.

Either we need to figure out what the script is doing and allow that case, or stop aborting on this error. Maybe with a preference.
"allow for that case" might mean "fix the bug in the script".

Code:
    if (request.responseText.contains("Whoops!  You're not actually in a choice adventure.")) {
      // Allow a script to simply attempt to visit choice.php.
      if (!urlString.equals("choice.php")) {
        KoLmafia.updateDisplay(
            MafiaState.ABORT, "Whoops! You're not actually in a choice adventure");
      }
      ChoiceManager.handlingChoice = false;
      return true;
    }

could become:

Code:
    if (request.responseText.contains("Whoops!  You're not actually in a choice adventure.")) {
      // Allow a script to simply attempt to visit choice.php.
      if (!urlString.equals("choice.php")) {
        if (Preferences.getBoolean("workAroundBuggyScriptsSubmittingChoices")) {
            KoLmafia.updateDisplay(MafiaState.ERROR, "Script submitted " + urlString + " when KoL was not in a choice adventure")
        } else {
            KoLmafia.updateDisplay(MafiaState.ABORT, "Whoops! You're not actually in a choice adventure");
        }
      }
      ChoiceManager.handlingChoice = false;
      return true;
    }

to allow scripts to continue and maybe give the script author feedback for fixing their bug. :)
 

adeyke

Member
As suspected, that version of the script had the same issues. However, setting abortOnChoiceWhenNotInChoice to false allowed the script to run to completion. My conclusion is that the script has always been bugged, and that bug only became noticeable with that KoLmafia change. However, I don't know the fix. The script seems rather impenetrable to me at the moment, and the limited nature of Batfellow makes experimentation difficult. Attached is the CLI output, for whatever that's worth.
 

Attachments

  • batoutput.txt
    67.8 KB · Views: 10

Boesbert

Member
I have noticed that after running the script (with abortOnChoiceWhenNotInChoice set to false), afterwards mafia does not recognize my torso awareness anymore. Mafia also thinks my stats are severely below what they actually are (this only gets fixed by logging out and back in again). Another thing that happens is that my MP gets almost depleted.
 

infopowerbroker

New member
I made three tweaks and it seems to work. I use a basic wrapper script to loop through and get a full set of consumables every few months.

I added the following to the start of my wrapper script:
Code:
cli_execute("set abortOnChoiceWhenNotInChoice = false");
cli_execute("refresh all");

I and I added this to the end of the wrapper script (after I was done looping through all the consumables):
Code:
cli_execute("set abortOnChoiceWhenNotInChoice = true");
cli_execute("refresh storage");

Finally, in batfellow.ash itself, I added the following around line 288, right before it tries to use the $item[Special Edition Batfellow Comic];
Code:
cli_execute("refresh all");

With those three things in place, it doesn't break on the noncombats, and it can find that I still have a backlog of comics to read.

I hope this helps!
 
Top