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: 7

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.
 
Top