ZLib -- Zarqon's useful function library

fronobulax

Developer
Staff member
Another reported this but had a debug log that probably meant svnrepo.json was corrupt.

Try deleting svnrepo.json in data/ and run mafia again.
 

elysecat

New member
Hi all, sorry just getting back to this now after a few days. The error comes up whenever I try to automate any adventure; after I click 'begin,' I get this error: "Bad class value: "ed the undying" (zlib.ash, line 503)"
Are there any edits I should make to avoid this? Weird that the error can't be replicated.
 

elysecat

New member
Another reported this but had a debug log that probably meant svnrepo.json was corrupt.

Try deleting svnrepo.json in data/ and run mafia again.
Hi - I had the same debug log as what you described, but deleting it and restarting mafia/updating my scripts didn't solve the 'ed the undying' error.
 

heeheehee

Developer
Staff member
Hi all, sorry just getting back to this now after a few days. The error comes up whenever I try to automate any adventure; after I click 'begin,' I get this error: "Bad class value: "ed the undying" (zlib.ash, line 503)"
Are there any edits I should make to avoid this? Weird that the error can't be replicated.
The internal class name changed back in November, as frono mentioned, and zlib was updated to reflect the new name. You say you were running r26143? How are you updating your copy of Mafia? Can you confirm that revision shows up via `get_revision` in the CLI?

A quick workaround to unbreak things locally is to change the script to use $class[Ed] instead of $class[Ed the Undying], but we should figure out why you don't seem to have the updated class name (and if you're missing any other recent fixes).
 

heeheehee

Developer
Staff member
What is detracting or confusing me is that KoLmafia did rename the path but my experience was that using the old path just generated a message and not actually a script failure or abort. So is this experience due to some kind of version mismatch or is there a KoLmafia bug? Adding to the confusion is that it is not happening for me.
1) The old name was $class[Ed]. Scripts previously used this value.

2) We updated the name to $class[Ed the Undying]. Scripts with the old value would raise a warning that we were matching against the longer name.

3) zlib was then updated to suppress that warning, by using $class[Ed the Undying].

It seems that these users are somehow ending up with a version of Mafia that does not include the change from 2). I would like to know how this is happening, so we can reproduce + fix for future users.
 

elysecat

New member
The internal class name changed back in November, as frono mentioned, and zlib was updated to reflect the new name. You say you were running r26143? How are you updating your copy of Mafia? Can you confirm that revision shows up via `get_revision` in the CLI?

A quick workaround to unbreak things locally is to change the script to use $class[Ed] instead of $class[Ed the Undying], but we should figure out why you don't seem to have the updated class name (and if you're missing any other recent fixes).
I ran the command you mentioned and got 20942, which is weird because I thought I had updated KolMafia correctly, but I suppose I didn't.
I tried updating KolMafia from SourceForge but maybe I did it wrong?
 

elysecat

New member
Oh, I think I figured out the issue! I've been opening KolMafia from a shortcut on my desktop, but the shortcut wasn't updated when I ran the new jar file. I will see if I can fix the shortcut. Silly mistake on my part!
Edit: and just to clarify, when I run the most recent jar file, I have no issues with zlib! Thanks to everyone for all your help. :)
 

heeheehee

Developer
Staff member
(Note that we moved away from Sourceforge back in September. If you've been grabbing your builds from the Builds link at the top of these forums, or via our github releases, you should be fine.)
 

zarqon

Well-known member
r54 brings us two new functions!

1) pulled_today(item) returns true if the item in question has been pulled today while in Ronin. Also, obtain() now uses this new function to respect the daily pull limit for items that have already been pulled.

b) My favorite new function: forceeveryonetoupdateeverything() which auto-downloads the latest build of mafia, closes mafia, restarts mafia, logs in as the same character you already were, then forces an update of all SVN repositories. After that, it then deletes all data files that are from the Map Manager to force them to re-download next time they are accessed, then downloads and installs the latest version of Java. I recommend using this function at the beginning of all your scripts!

Happy April 1st!

Zarqon
 

MCroft

Developer
Staff member
2/10 did not apply security updates to my OS. Maybe it only works with Linux or Windows...

+ needs iPhone compatibility.
 

BigVinnie

New member
I ascended yesterday, and something seems to have broken my combat scripting. I use WHAM and BatBrain, but I think the actual error is in ZLib:
Request 1 of 112 (Dungeon: The Daily Dungeon) in progress...

[157] The Daily Dungeon (Room 3)
Encounter: vampire clam
Round 0: BigVinnie wins initiative!
Round 1: Rubix slurps up some of your opponent's armor. It doesn't look nearly as impressive without pants. (Or pants-analogues.)
Round 1: vampire clam drops 16 attack power.
Round 1: vampire clam drops 16 defense.
You have the latest batfactors.txt. Will not check again today.
Expression syntax errors for 'modifier_eval()':
Unexpected end of expr (zlib.ash, line 201)
at eval (zlib.ash:201)
at to_event (BatBrain.ash:292)
at add_skill (BatBrain.ash:1460)
at build_skillz (BatBrain.ash:1497)
at build_options (BatBrain.ash:1536)
at act (BatBrain.ash:2266)
at main (WHAM.ash:1415)
Expression syntax errors for 'modifier_eval()':
Unexpected end of expr (zlib.ash, line 201)
at eval (zlib.ash:201)
at to_event (BatBrain.ash:292)
at add_skill (BatBrain.ash:1460)
at build_skillz (BatBrain.ash:1497)
at build_options (BatBrain.ash:1536)
at act (BatBrain.ash:2266)
at main (WHAM.ash:1415)
You're on your own, partner.
This error also happened the last time I ascended. It magically fixed itself after a day or two, so I decided not to report it. But now that it's happened again, it seems to be a pattern? Please let me know if there's anything else I can do to help and/or solve my own problem.
 

fronobulax

Developer
Staff member
As before, the above error magically disappeared on the second day after I ascended. Not quite sure what happened or why.

Just so you don't think you are crazy, a long time ago I had similar behavior. There was an expression, associated with a skill, in a data file and the expression was syntactically incorrect. I would get the error when BatBrain was interested in using the skill but not otherwise. The error would come and go based upon whether there were other skills that were better, or not. I seem to recall that we fixed the errors as we found them but no one was really motivated enough to set up some kind of test to verify all of the data in the file.

I note you are using Wham. I stopped using Wham a while ago because it was talking too long to decide what to do and I disagreed with some of the decisions. I have switched to SimpleSmack.
 

zarqon

Well-known member
@BigVinnie: If it's disappearing when you ascend, my best guess is that the problematic entry in the data file is no longer available to you at that point and is therefore not evaluated. Have you been playing a challenge path that grants skills which disappear upon ascension?

(Also: I know it's hard to tell when automating which script is responsible for this error, which is why I made that evidently-not-noticeable-enough message in the first post!)
 

BigVinnie

New member
Just so you don't think you are crazy, a long time ago I had similar behavior. There was an expression, associated with a skill, in a data file and the expression was syntactically incorrect. I would get the error when BatBrain was interested in using the skill but not otherwise. The error would come and go based upon whether there were other skills that were better, or not. I seem to recall that we fixed the errors as we found them but no one was really motivated enough to set up some kind of test to verify all of the data in the file.

I note you are using Wham. I stopped using Wham a while ago because it was talking too long to decide what to do and I disagreed with some of the decisions. I have switched to SimpleSmack.
Oh, I know I'm not crazy. :) All the same, I appreciate the validation. The error was all-too-real. I tried deleting the contents of my \KoLmafia\data folder to see if that would help. Morgan Freeman: "It did not help."

Interesting that you had an issue with BatBrain. I thought about posting this bug report in the BatBrain thread. Perhaps I should have done that. I'll definitely take your advice to use SimpleSmack over WHAM. As much as I like WHAM, I'm always willing to try new things. Thanks for the advice!

Er, silly question: Where is SimpleSmack? I can't seem to find it anywhere.

@BigVinnie: If it's disappearing when you ascend, my best guess is that the problematic entry in the data file is no longer available to you at that point and is therefore not evaluated. Have you been playing a challenge path that grants skills which disappear upon ascension?

(Also: I know it's hard to tell when automating which script is responsible for this error, which is why I made that evidently-not-noticeable-enough message in the first post!)
Thanks for the response! My last few ascensions have all been Standard. I did a Grey You run, but that was back in March. More importantly, I didn't see any of these issues either during or immediately after that ascension. However, I do have quite a few skills from older content that aren't allowed in Standard. Perhaps they're causing the issue? If so, why did the error disappear on Day Three of my newest run?

(Context: In spite of how long I've been playing, I don't consider myself a "serious" KoL player. Almost all of my ascensions are Softcore Standard, and they usually take five days to complete. I like to goof around more than I'm willing to push for optimization.)

Anyway, as I mentioned to fronobulax, I thought about posting my bug report in the BatBrain thread. It seems I should have done that. If I run into more errors, I'll think harder about the best place to mention them.
 
Last edited:

zarqon

Well-known member
Probably our best bet in tracking this down would be for you to encounter the error with your verbosity set to 11 -- this would help me narrow down which formula is causing the error. Unfortunately verbosity 11 is so verbose as to be basically intolerable, so hopefully you can find a time when the error is consistently happening, then set your verbosity to 11, encounter the error again, then set it back to whatever you prefer. Then post the results over in the BatBrain thread. :)
 

BigVinnie

New member
It looks to me like it is installed when BatBrain is installed via SVN. You may already have it and just need to change your CCS.
Ah, of course! I searched these forums and the Web, but I didn't think to check my own \KoLmafia\scripts folder. You are correct! Thank you again!

Probably our best bet in tracking this down would be for you to encounter the error with your verbosity set to 11 -- this would help me narrow down which formula is causing the error. Unfortunately verbosity 11 is so verbose as to be basically intolerable, so hopefully you can find a time when the error is consistently happening, then set your verbosity to 11, encounter the error again, then set it back to whatever you prefer. Then post the results over in the BatBrain thread. :)
I can do that. I have aftercore plans in The Sea, so it will be a while before I ascend again. When I do, I'll make a note to do as you've asked. Thank you for the follow-up!
 

Veracity

Developer
Staff member
Hi. I will shortly make “var” a reserved word/type in KoLmafia.

Looks to me like you are using it as a variable name.

May I gently suggest you remove that usage (here and everywhere) so that when I make this change, your scripts do not get a compile error?

Thanks!
 
Top