The Undiscovered Craftery

jasonharper

Developer
This little script will generate a list of all of the creatable items that aren't already listed on your Discoveries pages. It's trophyriffic!

Unfortunately, ASH has no way of determining what technique is used to create any given item - that's something you don't normally have to worry about with KoLmafia! Therefore, the script may list some items that are created from two others, but by some means other than the basic crafting skills - Crimbo toymaking, for example. Such items won't count as discoveries, even if you're still able to make the item at all.

Code:
print("The Undiscovered Craftery v1.0, by [email]JasonHarper@pobox.com[/email] (in game: Seventh)");

string disc(string type) {
	return visit_url("craft.php?mode=discoveries&what=" + type);
}

void main() {
	string known = disc("combine") + disc("cook") + disc("smith") +
		disc("cocktail") + disc("jewelry");
	
	int[string] unmake, closet, display, other;
		
	print("You have the ingredients needed to make these undiscovered items.",
		"blue");
	for i from 1 upto 4000 {
		item it = to_item(i);
		int[item] parts = get_ingredients(it);
		int nparts = count(parts);
		if(nparts < 1 || nparts > 2) continue;
		boolean valid = true;
		if(nparts == 1)	
			foreach p1 in parts
				if(parts[p1] != 2) valid = false;
		else
			foreach p2 in parts
				if(parts[p2] != 1) valid = false;
		if(!valid) continue;
		
		string name = to_string(it);
		if(contains_text(known, "<b>" + name + "</b>")) continue;
		if(creatable_amount(it) > 0) print(name);
		else if(item_amount(it) > 0) unmake[name] = 1;
		else if(closet_amount(it) > 0) closet[name] = 1;
		else if(display_amount(it) > 0) display[name] = 1;
		else other[name] = 1;
	}
	if(count(unmake) > 0) {
		print("You have these undiscovered items, but not their ingredients.",
			"blue");
		print("Any that are meatpasted, you can untinker & rebuild.",
			"blue");
		foreach un in unmake print(un);
	}
	if(count(closet) > 0) {
		print("You have these undiscovered items in your closet.",
			"blue");
		print("Any that are meatpasted, you can untinker & rebuild.",
			"blue");
		foreach cl in closet print(cl);
	}
	if(count(display) > 0) {
		print("You have these undiscovered items in your display case.",
			"blue");
		print("Any that are meatpasted, you can untinker & rebuild.",
			"blue");
		foreach di in display print(di);
	}
	if(count(other) > 0) {
		print("You neither have these undiscovered items, nor their ingredients.",
			"blue");
		foreach ot in other print(ot);
	}
	print("Done. Note that these lists may include items made by means other " +
		"than crafting (such as multi-use), that wont't count as discoveries.",
		"blue");
	
	
}
 

Attachments

  • undiscovered.ash
    2 KB · Views: 292

DrEvi1

New member
Not sure what I am doing wrong, but when I run this script, it says updating display case for a few minutes and then eventually says requests complete, but I get no output or anything.
 

jasonharper

Developer
DrEvi1: What version of KoLmafia are you using? Do you have a huge amount of items in your display case? You could try deleting the line in the script that says else if(display_amount(it) > 0) display[name] = 1;, but I don't see how it could have prevented you from getting any output at all.
 

noxious

New member
[quote author=DrEvi1 link=topic=1924.msg9093#msg9093 date=1223060659]
Not sure what I am doing wrong, but when I run this script, it says updating display case for a few minutes and then eventually says requests complete, but I get no output or anything.
[/quote]

Thought I was having the same problem, and i was freakin a lil bit when it updated the display case (that i dont even have) for like, forever... turns out it works great. I love completionist scripts like these :)
 
Awesome stuff, would be neat if it could split it into the categories, but I don't know whether that's possible or not.
 

jasonharper

Developer
Categorizing the results would either require an explicit list of all the known discoveries (which I wouldn't want to have to maintain), or a function added to ASH to determine the crafting type used to make an item (which probably wouldn't be useful to any other script than this one).
 
Yeah, I figured as much. I was talking about the crafting type rather than category.

Still! Really cool script... helped me a lot
 

Muhandes

Member
Great script, thanks for all your great work.

One comment: the script does not report things you don't have the skill to make. Specifically since I don't have Armorcraftiness, Really Expensive Jewelrycrafting, or any of the PM/S food skills, these weren't reported. This is probably intentional, but if it is easy to do, it might be useful to get the entire list.

It might be more of the same thing, but as I'm not a myst zodiac (I'm actually in BM) the following weren't reported:
gloomy mushroom wine
oily mushroom wine
Pregnant gloomy black mushroom
Pregnant oily golden mushroom
spooky glove

green beer wasn't reported, again, probably because it cannot be made today.

Magical ice cube with a fly in it drinks are not reported. These do not count for trophies, but they do appear in the discoveries list. This, again, might be because I'm in BM and cannot get Magical ice cube with a fly in it.

One bug - I have discovered Frost brand sword, the script says I didn't. Might be because of the "TM".
 

Muhandes

Member
[quote author=Shiverwarp link=topic=1924.msg9189#msg9189 date=1223695628]
The fly ice cube drinks were reported for me. And they do count for the discoveries list.
[/quote]
I said in my post that they appear in the discoveries list. Are you sure they count for the trophy? I was told they don't, but since I have the trophy already I have no way of testing this.
Anyway, this is irrelevant to this script. My guess remains that since I'm in BM with no way of getting the materials, it doesn't show.
 

jasonharper

Developer
The script knows nothing about access to ingredients; it only cares about availability of crafting methods. No special skill is needed to make the fly drinks, so it sounds like you simply don't have a cocktailcrafting kit or bartender.
 

Muhandes

Member
[quote author=jasonharper link=topic=1924.msg9198#msg9198 date=1223747874]
The script knows nothing about access to ingredients; it only cares about availability of crafting methods. No special skill is needed to make the fly drinks, so it sounds like you simply don't have a cocktailcrafting kit or bartender.
[/quote]
That was probably it, since I now see all of them.
The only remaining bug is the frost brand sword which I discovered, but still shows up.
 
Top