ZLib -- Zarqon's useful function library

zarqon

Well-known member
@Xenthes: aliases are global -- they apply to your installation of KoLmafia, not to your character.

@heeheehee: Do you also include choiceadv numbers for these options? Seeing what's possible is good, but seeing what's actual -- or further, changing what's actual into what's possible where needed -- would be optimal.

I suppose I should just look at the file, but I'm taking advantage of your helpfulness. :)
 

heeheehee

Developer
Staff member
Choiceadv numbers? Which script uses that?

Edit: Oh, you're talking about noncombats.txt. Those don't include choiceadvs or what's actual. That'd be too much work. Maybe a separate script for setup?
 
Last edited:

zarqon

Well-known member
If it could get the choiceadv numbers along with the options, BBB could easily adjust choiceadvs for optimal goal farming.

Further, profit_fx could determine your profit based on your current choiceadv settings, and recommend changes to increase profit (skipping unprofitable choiceadvs, or getting more profitable items).
 

zarqon

Well-known member
How about string[location,int] for a format? The int would be the choiceadv number, and the string would contain what the option does, i.e. "item xxx" or "monster xxx" or "skip".
 

heeheehee

Developer
Staff member
Erm, some locations have multiple choice adventures. =P

And some noncombats that aren't choice adventures at all.
 

jasonharper

Developer
You generally wouldn't need to worry about choiceadv settings - if receiving an item is the direct consequence of a particular choice, then its presence in your goals will force that choice to be taken, overriding your normal settings.
 

halfvoid

Member
just got this with zlib 19 and the newest daily build.

"if" requires a boolean conditional expression (BestBetweenBattle.ash, line 236)

236 foreach num,mob in get_monsters(my_location()) if (has_goal(mob)) return false;
 

halfvoid

Member
hah. didn't see it. will do so now.

UPDATE: fixed everything, and i do mean everything.
 
Last edited:

heeheehee

Developer
Staff member
Anyway, back to the whole noncombats thing -- if we're still considering using goals, then I guess you'd have to set very particular, unachievable goals. Like "999999 globe of deep sauce".

But if we're going to map it out, I'd suggest rewriting noncombats.txt so that it'd be just for non-choice-adventures. Choice adventures would go in a different map organized as such: string[location, int, int] map, where the first int is the index (the choiceadv number, preferably), and the second one is the option. The string is still what the option would do. But oh man, that'd take almost forever to flesh out. I guess I'll start working on it, but I can't make any promises as to when it'll be done.

Edit: Blah, adventures like the Louvre are just annoying. =(
 
Last edited:

zarqon

Well-known member
Oops I forgot an int -- but I still think string[location, int, int] would work for everything:

location => encounter number (0 for non-choices, otherwise choiceadv number) => choice number (1 and up) => consequence.

Encounters with only one choice would be treated as non-choices. I don't like the idea of splitting it up, when part of the point for this layout was being able to use count(map[location]) to get the number of noncombats.
 
Okay, so here's a [stupid] question... I guess I still don't know what this is for exactly. I have it downloaded to go with the other scripts that I have for Mafia, but what exactly is its function? I guess I need more layman's terms. /embarrassing n00b question
 

Bale

Minion
I have it downloaded to go with the other scripts that I have for Mafia, but what exactly is its function?

zlib is a library of functions for other scripts to use. zarqon has created and maintains some rather complicated functions so that other script authors can use them instead of needing to invent their own. It's like he has invented the wheel. It's not much good without a cart, wheelbarrow or bicycle, but he lets all other programmers use his wheels so that they don't need to re-invent the wheel for use in the vehicles they make.
 

slyz

Developer
Ignore me, I thought we were talking about BatMan. Listen to bale. Listening to Bale is generally wise.
 

zarqon

Well-known member
Well put, Bale. ZLib is capacitors, pistons, and servos. ZLib is a box of assorted LEGOS. ZLib is a stocked pantry. ZLib is evolution towards order but without form.
 

Muroni

New member
I'm getting the message : Function 'item_drops_array( monster )' undefined (zlib.ash, line 232)

(Don't know if my previous post was removed or if somehow I didn't submit it!)
 

Bale

Minion
Jeezus. How many times has that question been answered today?

How many times a day has that question been answered, every single bloody day since the last update? Several threads are FULL of people asking the same question again and again and again. I answered it earlier today in another thread. It has been answered twice on this page of this thread. It's starting to get a trifle annoying!
 
Top