Potion Checker

Spiny

Member
Potion Checker v 1.0

Bale made an updated relay version of this script here!

What is it?

This is an informational tool to help you figure out what sauceror-created potions you have or don't have. Wait... there's more! It also tells you what each potion's effect name is and what it does! And better yet, what components you need to make it and how many of these components you have and how many of the potions you can create!

This is offered to you in a fairly easy to read table format, one per each sauce skill: Advanced Saucecrafting, The Way of Sauce, and Deep Saucery.

Please note that this only looks at what you have on hand and it doesn't care about anywhere other than your inventory on hand. I figure if you have any relevant things in your closet or DC that you've got them there for a reason so as NOT to use them or consider them for anything.

How to use it?

Download the attached file and unzip it.

Place potmap.txt into your mafia data folder and potion_checker.ash into your mafia scripts folder.

Code:
Usage: potion_checker.ash list {advsauce|1|waysauce|2|dsauce|3}

Changelog:
Version 1.0 - Public Release
 

Attachments

  • potion_checker.zip
    4.1 KB · Views: 180
Last edited:

Spiny

Member
don't argue with her, she made kolmafia

Veracity is one of a handful of developers that work on Kolmafia, she didn't "make" it. But she generally knows what she's talking about and one shouldn't argue with her, or anyone, unless one has some facts / proof to back up their position... especially in one of my threads ;)
 

DaMaster0

Member
Ok, here's some evidence: I was trying to download ascend.ash and I got this:

oi7qj7.png


It could just be because it was password protected though...
 

Veracity

Developer
Staff member
Bingo. You had no problem downloading it, but when Safari tried to decompress it, it didn't know what to do with the password. It called "Archive Manager" or something, which didn't know what to do.

Now, if you go and control-click on the .zip file from the Finder, you can specify that you want to open the .zip file with Stuffit Expander - which will prompt you for the password.

A .zip file is a .zip file; contrary to your assertion, the macs do NOT "have their own version of .zip files".

I got Stuffit Expander for free when I installed some version of Mac OS X. Even if you didn't, a google of "stuffit" leads you right to stuffit.com, where you can get the utility for free, which contradicts your assertion "you can't use a zip file" because "you are on a mac".

I bought my first Mac in 1988. I do all of my KoLmafia development on one. I do think I know what I'm talking about.
 

zarqon

Well-known member
Wow, I finally gave this a shot and wished I would've tried it sooner! The output is quite thorough and helpful, and really lovely to boot.

I made a few small changes to it that I liked enough to mention here. Because I like typing less, I condensed the options-parsing part as follows:

Code:
...
void main(string options) {
	if (contains_text(options,"1") || contains_text(options,"adv")) AdvancedSaucecrafting = true;
	if (contains_text(options,"2") || contains_text(options,"way")) WayOfSauce = true;
	if (contains_text(options,"3") || contains_text(options,"deep")) DeepSaucery = true;
	if (contains_text(options,"make")) skipunmakeable = true;
	if (!AdvancedSaucecrafting && !WayOfSauce && !DeepSaucery) { Usage(); return; }

	buffer tblAS;
...

This has the benefit of allowing more than one category to be specified, i.e. "potion_checker 123" will show all three tables.

I also added skipunmakeable = false; toward the top, and this:

Code:
void TableRow(buffer table, item i, string color) {
	if (skipunmakeable && creatable_amount(i) == 0) return;
	table.append("<TR>");

This allows users to only show potions they can presently make by including "make" in the options.

Hmmm, can I make any Deep Sauce potions at the moment? "potion_checker deep make" Nope. Well, what ingredients do I need then? "potion_checker deep" Ah, ok.

Thanks for sharing this lovely tool!
 

Spiny

Member
At the time that I wrote the code, I recall there being a buffer limitation as far as display in the CLI, where if I wanted to see all three tables at once, it worked fine the first time, but subsequent calls would show nothing but a blank screen. Admittedly, I haven't messed around with this in a while as I've had other interests. I keep thinking that one day I will do something similar for Cocktailcrafted drinks as I'm always running to the wiki to see what I need to make drinks with my garnishes and bottles on hand.

*laughs* I wrote the above and forgot to thank you for your compliments... thank you! :D
 
Last edited:

Spiny

Member
Zarqon's tweaks are easily includable, but the problem remains that if one does NOT want to disable seeing unmakeable potions, there is no way to see all three charts at once due to CLI buffer limitations (the first table always scrolls off). In short, while his tweaks do save typing when calling the script, it doesn't solve the space issue in the cli buffer itself which is one reason why I set the script up with distinctly separate tables to begin with.
 
Top