ZLib -- Zarqon's useful function library

The script you are running (in this case WHAM) is somehow giving a bad formula to ZLib, so although the function in ZLib (which unfortunately can't vet the formulas before attempting to evaluate them) throws an error, the source of the error is in the script sending the information.

So you should go report it in the WHAM thread.

Except... WHAM includes BatBrain, which is the culprit in this and all the other cases of that error reported in this thread.

So you should go report it there. In the thread of the script that is not mentioned in the error, and was not the actual script you thought you were running.

Totally obvious, right? :P

Unfortunately, that's not obvious at all, because so far there have been EIGHTY-SEVEN posts in the ZLib thread about expression syntax errors caused by BatBrain (roughly 8% of all posts in this thread). I just counted them. Or if you count them from the first occurrence, OVER 40% of posts in this thread since then have been about BatBrain errors.

I'll be adding a nice boldface message to the first post now. Hopefully it helps redirect people, but I wish there was more I could do.

EDIT: And done. Do you think it should be bolder? Maybe it should be bolder.
 
Last edited:
BTW, the function be_good(familiar) needs to be updated for "Actually Ed the Undying" because he cannot use familiars, like an Avatar Path.
 
r27 lets calling scripts know that familiars are not good for Ed.

Also, best refrigerator ever. :D Thanks for that Bale.
 
r27 lets calling scripts know that familiars are not good for Ed.

Also, best refrigerator ever. :D Thanks for that Bale.

I can remove my Ed's familiar workaround for newLife. :D

And I'm glad you enjoyed seeing someone's experience shopping for a refrigerator.
 
Hmm suddenly getting a NPE when calling my rollover script, did something change with the file_to_map function?


Code:
Script execution aborted (java.lang.NullPointerException): (zlib.ash, line 260)

Line 260: file_to_map(fname+".txt",dest);


         KoLmafia v16.8 r15771, Windows 7, Java 1.8.0_40
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread of KoL's
 Gameplay-Discussion forum. If you would like the KoLmafia dev team
 to look at it, please write a bug report at kolmafia.us. Include
 specific information about what you were doing when you made this
 and include this log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Sun Apr 26 20:29:34 PDT 2015
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
	at java.io.ByteArrayInputStream.<init>(Unknown Source)
	at net.sourceforge.kolmafia.textui.DataFileCache.getReader(DataFileCache.java:165)
	at net.sourceforge.kolmafia.textui.RuntimeLibrary.file_to_map(RuntimeLibrary.java:6193)
	at net.sourceforge.kolmafia.textui.RuntimeLibrary.file_to_map(RuntimeLibrary.java:6184)
	at sun.reflect.GeneratedMethodAccessor157.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:106)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:154)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:435)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:153)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:154)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:435)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:153)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:154)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:435)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:96)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:68)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:435)
	at net.sourceforge.kolmafia.textui.Interpreter.executeScope(Interpreter.java:377)
	at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:325)
	at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:318)
	at net.sourceforge.kolmafia.textui.command.CallScriptCommand.call(CallScriptCommand.java:256)
	at net.sourceforge.kolmafia.textui.command.CallScriptCommand.run(CallScriptCommand.java:75)
	at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:596)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:549)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:450)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:318)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:187)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:163)
 
did something change with the file_to_map function?

Yes, I fixed an issue that allowed people to create files anywhere on your computer. I'm not surprised I broke something along the way, but making everything work while keeping that bug closed will be nontrivial (for me anyway).
 
Actually, your debug log says 15771, and the change I made was in 15780. A basic check shows that file_to_map() isn't completely broken right now, so I'm not sure what to make of your post.
 
What would help would be telling us what location your file_to_map is in - what command are you running, exactly?
I would expect lost's change to have modified map_to_file more than file_to_map, but it does make sense that the two would be linked.
 
Yes, there isn't a link between those. No, we don't know exactly what he was running and if that works for other people or if something else may have affected it.

To fully validate, we'd need both the execution command as well as the script(s) being called, if the command itself doesn't bring a complete answer. But as a first step, the execution command would have provided some information as to what might have failed to be turned into a byte array.
 
Yes, there isn't a link between those. No, we don't know exactly what he was running and if that works for other people or if something else may have affected it.

To fully validate, we'd need both the execution command as well as the script(s) being called, if the command itself doesn't bring a complete answer. But as a first step, the execution command would have provided some information as to what might have failed to be turned into a byte array.

I am 100% sure that the version that produced the debug log was not due to 15780 because the line number in the debug log for DataFileCache doesn't match anything meaningful after my change.

I'm guessing that something weird happened for fxer, and if anything was actually broken then the large number of zlib users would likely have rushed here to report issues by now.

I also think it's unlikely that fxer can even reasonably provide the details you're asking for, since it was certainly some other script doing any number of things that led to who knows what chain of function calls in zlib.
 
Ran everything today under 15781 with latest svn updates, didn't get any errors. Guess it can be chocked up to whatever-the-fug
 
Any idea what this error is? Using zlib r27, mafia r15858 (also latest svn WHAM/smartstasis/batbrain)

Code:
[425445] photocopied monster
Encounter: clod hopper
Round 0: fxer wins     initiative!
Base round: damage, player damage, 0 meat
Expression     syntax errors for 'modifier_eval()':
Expected end, found def -115.0*0.1     (zlib.ash, line 188)
You're on your own,     partner.
 
Last edited:
Any idea what this error is? Using zlib r27, mafia r15858 (also latest svn WHAM/smartstasis/batbrain)
Code:
item    4137    slime stack     monsterhp*0.15  0       att -monsterattack*0.1 def -monsterdefense*0.1
It looks like there's a comma missing before def.
 
Back
Top