ZLib -- Zarqon's useful function library

Winterbay

Active member
If you go to your /data-folder and open up the zversions.txt and remove the zlib-line it won't complain anymore (but it will check the version once more) :)
 

zarqon

Well-known member
@Donavin: You need do nothing, anymore. I have now altered the declaration of my_defstat() with an optional boolean parameter. If omitted, the default handling will be functionally equivalent to the old, before ever it was speculative. Only if called with a parameter of true will it use the speculative value.

This ought to do nicely for that function, at least for now. However, the knowledge that _spec is empty when no speculation has happened -- rather than simply returning unmodified values -- lends a spurious nature to several other of my functions which were made transparent to speculation; has_goal(), for instance, is now almost certainly circumspect. A broader solution is needed.

@Theraze: It is indeed unfortunate that this script author, full knowing the import of including non-numeric characters, yet chooses to do so. Those of us with a sense of propriety look for the day when he may yet remove this extraneous letter, and relieve the mafia-employing world of much noisome clutter.

I have this night been reading an illuminating recounting of the 1893 Chicago World's Fair, and my mind is thereto inundated with the speech of this long bygone era; I must beg your pardon for my affected idiom.
 

Theraze

Active member
Heh. With Winterbay's suggestion to just delete the zversions.txt file (or the line, but hey... the file is easier), that takes care of the immediate problem and I only have to see the warning once per rollover instead of every adventure and 4* when CounterChecker fires. Since that triggers CanAdv as well as BestBetween, and BatBrain/SmartStasis (if there's a combat involved), and they all import zlib...
 

zarqon

Well-known member
It's speculating about how dangerous various poisons are (it may also speculate about getting Embarrassed, I'd have to check). Effects may certainly be acquired during combat. Also, I'm eventually looking for BatBrain to be useful outside of combat to predict outcomes of facing various monsters, and it would be nice for it to be speculation-savvy for that. That was originally part of the logic behind using a global monster variable and wrapper functions for player and monster stats.
 
Last edited:

Bale

Minion
I guess that works. In a very weird way. It's even weird that the parameter is unspec instead of spec so that unspec being false gives me the feeling of facing down a double-negative.

And wouldn't it simply be cleaner to use ("Buffed Muscle") instead of needing to use a whatif when unspec is true? It would certainly run faster in that instance.

Whatever. At least it isn't bugged now.
 

Donavin69

Member
I am having trouble figuring out the format of the KMail function. Specifically, sending an item, it calls for an int [item], how do I specify that?
PHP:
boolean send(string player, item it) {
	vprint("Trying to send "+to_string(it)+" to "+player,6);
	if (item_amount(it) > 0) {
		int [item] stuff;
		stuff[it] = 1;
		if (!kmail(player, message,0,stuff))
			vprint("Unable to send "+to_string(it)+" to "+player,4);
	}
	Return TRUE;
}

EDIT: I feel really stupid....I didn't have the item, and had enough error checking set that it didn't try because I didn't have it.
 
Last edited:

Theraze

Active member
Question... can we have obtain also allow for autostops? I think all that zlib would need to add to change this would be changing the two spots in obtain with this:
Code:
($strings[choiceadv, pirate insult, arena flyer ml] contains cond)
to this:
Code:
($strings[choiceadv, autostop, pirate insult, arena flyer ml] contains cond)
Or maybe putting autostop before choiceadv... wasn't really sure. The two are somewhat related, as are the insult and flyers, so it didn't feel correct to put it onto the end. :)
 

Bale

Minion
That is amusing. He really wanted to compliment Character Info Toolbox, but accidentally complimented you by accident. Then he removed the compliment and replaced it with a compliment and an apology. Loi.
 

bsander

Member
Is bestfamiliars.txt still being maintained? I noticed it misses the Groose and the Kloop, because the Groose is my only trendy Leprechaun right now but best_fam() doesn't recognize it as such. But when I look more closely I see many other familiars aren't present too. I'd add them locally but the numbers used in that file don't make a lot of sense to me..
 

Theraze

Active member
Anyone can update it, now that the map site is working again. It just takes someone deciding what weighting to give to things that aren't strictly equivalent...
 

zarqon

Well-known member
I just tried it and it worked fine for me. Are you sure it's just a plain text file? With the .txt extension?
 

Banana Lord

Member
Hmmm. I tried a different file and it went through fine. I'm not sure why the other one isn't working. I tried downloading it and re-uploading it to see what would happen and it threw the same error.

EDIT: Yeah, I've got no idea. File's attached. Unicode (UTF-8), Unix (LF), plaintext, .txt etc. It's probably going to turn out to be something stupid and obvious, but hopefully you won't laugh at me too much :p

EDIT2: That file had a couple of apostrophes in it, but they weren't the cause of the problem. Updated file anyway.
 

Attachments

  • HAR_Options.txt
    5.8 KB · Views: 39
Last edited:

Theraze

Active member
I did have the same problems with your HAR_Options, though I did update the postal_locations file about 2 weeks ago. However, this would probably best be served continued in the Map Manager thread, not the (mostly unrelated) zlib thread...
 

Banana Lord

Member
Oh damn. I *knew* there was a more appropriate thread. I scratched my head for five minutes before shrugging my shoulders and posting here. If a minion wants to shift the relevant posts over that would be handy, otherwise I'll repost there I guess.
 

Bale

Minion
New challenge path requires new feature for be_good().

Code:
      case "Avatar of Boris": 
         if(johnny.to_familiar() != $familiar[none]) return false;
         return !($slots[weapon,offhand] contains johnny.to_item().to_slot()) || johnny == "Trusty";
 
Top