I wrote an .ash script that plays Dungeon Fist! for me, by calling visit_url() repeatedly with the proper moves. It works perfectly the first time it plays, no unexpected behavior at all. I can adventure normally after running the script, and even play Dungeon Fist! manually or via gm script.
But when the script plays the game a second time, whether as part of a loop, or being invoked separately, every visit_url() returns the "Unexpected error, debug log printed." msg, as does everything that I try to do in mafia after that (adventure elsewhere, do a summons, whatever). However, despite the error msgs, the script still plays through the game correctly - I don't think it's sending anything broken, but rather that mafia is now having trouble with the responses.
I'm at a bit of a loss to figure out why it works perfectly for a single game, but everything breaks when I revisit the arcade.
The relevant bit of the logged debug msg is:
Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
at net.sourceforge.kolmafia.request.ArcadeRequest.findChoiceName(ArcadeRequest.java:326)
at net.sourceforge.kolmafia.request.ArcadeRequest.postChoiceDungeonFist(ArcadeRequest.java:716)
at net.sourceforge.kolmafia.session.ChoiceManager.postChoice1(ChoiceManager.java:2867)
at net.sourceforge.kolmafia.request.GenericRequest.processResponse(GenericRequest.java:1779)
at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1728)
at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1423)
at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1161)
at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1052)
at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:73)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:1546)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:1517)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
But when the script plays the game a second time, whether as part of a loop, or being invoked separately, every visit_url() returns the "Unexpected error, debug log printed." msg, as does everything that I try to do in mafia after that (adventure elsewhere, do a summons, whatever). However, despite the error msgs, the script still plays through the game correctly - I don't think it's sending anything broken, but rather that mafia is now having trouble with the responses.
I'm at a bit of a loss to figure out why it works perfectly for a single game, but everything breaks when I revisit the arcade.
The relevant bit of the logged debug msg is:
Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
at net.sourceforge.kolmafia.request.ArcadeRequest.findChoiceName(ArcadeRequest.java:326)
at net.sourceforge.kolmafia.request.ArcadeRequest.postChoiceDungeonFist(ArcadeRequest.java:716)
at net.sourceforge.kolmafia.session.ChoiceManager.postChoice1(ChoiceManager.java:2867)
at net.sourceforge.kolmafia.request.GenericRequest.processResponse(GenericRequest.java:1779)
at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1728)
at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1423)
at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1161)
at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1052)
at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:73)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:1546)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:1517)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)