ZLib -- Zarqon's useful function library

StDoodle

Minion
That's what I was thinking. Or rather, one of two things.

1) A pre-defined settings map as string [string] that has each key (preference) set to the value upon execution of the pseudo-abort.
2) An optional function or list of functions to invoke via call.

I would simply overload your functions, but since there is already a variable number of string parameters that could be used (to specify color), this could get tricky. Though I guess I could just use maps for both preferences & functions to avoid this.... but I hate shoe-horning stuff onto someone else's script, in case they decide to make changes that bork things further down the road.
 
Last edited:

zarqon

Well-known member
Hmmm. I missed the implementation of the ASH "call" command and then never figured out what it did after that. Now that I've had a look on our rapidly-approaching-comprehesive Wiki, that's a nifty idea. However, I still don't see the need. If you need to make a "do this on exit" function in your script anyway, why not just include vprint(message,0) in that function, rather than vice versa?

cf. OCW's die():

PHP:
void die(string die_message) {
   vprint(die_message,-2);
   print("Restoring initial settings...");
   set_property("battleAction",previous_battleaction);
   use_familiar(previous_familiar);
   cli_execute("outfit checkpoint");
   print("OCW stopped.");
   exit;
}
 

StDoodle

Minion
Hmm, that may be the better way to go, as I'd only need to handle aborting calls instead of handling everything (stuff that doesn't abort could use vprint() as per normal).
 

rimba

New member
Hey, I was just checking out other scripts by Zarqon since BBB and FTF turned out to be so awesomely useful. Long story short, when running hardcore checklist it didn't do anything helpful. To figure it out, I made a fresh copy of Kolmafia, thinking that it'd run alright and I could see what the problem is possibly. Turns out, Verbosity doesn't get a setting in the vars file, just a blank space where the number should be, making the checklist run through all the checks but not return anything (also causes "zlib vars" to return nothing which kind of threw me off the scent for a while). Setting verbosity to 3, like Zlib wanted to in the first place, fixed it.

I'm no scripter, but it seems to be similar to the problem jeffles was having is post 394 which is what twigged me to check the vars_me file.

So yeah, sorry for the kmail spam there. Corking good scripts though, cheers for them.
 

heeheehee

Developer
Staff member
Hmm. Line 474 of ZLib reads:
PHP:
setvar("verbosity",3);

It -should- automatically set verbosity to 3 the first time you run any ZLib-based script on a given character. (That's all that line does, so don't think that changing it will change verbosity automatically.)
 

Effusus

New member
Sorry if I'm doing something obviously wrong, but whenever I try to run a script that uses zlib.ash, I get the same error message: "Function 'item_drops_array( monster )' undefined (zlib.ash, line 218)". What is happening here?
 

Bale

Minion
Read the answer given to the last dozen people to ask that question.

(You are very far from the only one to post without reading the forum -- people have been asking that for the last month.)

Update mafia. New version here.

:sigh:
 

zarqon

Well-known member
I just got an Android phone -- now I'm daydreaming about a mobile version of KoLmafia! :)

Seems like since it's written in Java that would actually be doable -- by someone with too much time on their hands.
 

Winterbay

Active member
I'd love to get an WebOS (also partly based on java) application as well while we're on that thread, but I guess it'll be way too much work to actually do.
 

Pazleysox

Member
Function 'item_drops_array( monster )' undefined (zlib.ash, line 218)

I installed the new version just a few minutes ago, and was about to start OCW script, when i get this error. :(

-PazSox
 

Winterbay

Active member
Did youget version 14.0 or the latest .jar-build from builds.kolmafia.us? I think the latest official build is still too old for item_drops_Array().
 

Pazleysox

Member
I'm using an old full version of mafia. v13.9, because the last time I tried a daily build, it didn't recognize (tavern) in the ascend.ash script. I will update now, thanks!

EDIT:

I updated my version of mafia, got the new version of zlib.ash to work. Now... What the hell is up with THIS:

New Version of ZLib Available: : 8
Upgrade ZLib from : 20 to : 8 here: http://kolmafia.us/showthread.php?t=2072

!?!?!
 
Last edited:

fronobulax

Developer
Staff member
You might be interested in this Ascend thread since it has a solution to the Tavern problem.

The update ZLib message you quoted is a known issue with a simple fix along the lines of setting or editing a parameter. Alas my search-fu is not finding the answer at the moment.
 

Winterbay

Active member
You might be interested in this Ascend thread since it has a solution to the Tavern problem.

The update ZLib message you quoted is a known issue with a simple fix along the lines of setting or editing a parameter. Alas my search-fu is not finding the answer at the moment.

Type into the CLI:
Code:
zlib _version_zlib=\: 20

and it should fix that part.
 

Doc

New member
I'm getting a strange error in the script, when I run it or any script that requires it it gives me an "Expected ), found aggregate (zlib.ash, line 146)" Is this common? How does one fix it? I have downloaded the file multiple times and put the newer downloads in place of the old ones.
 

Doc

New member
Thanks :D I'm on a mac though and having some trouble with that, is there something else I should be downloading?
 
Last edited:
Top