Outfit Obtainer Scripts [WIP / Release]

Well, obtain will do the buy as well... so you don't need the check...

Unless there's a reason to try to get two? Outfit a friend?
 
Yep. This is part of why I am "using zlib.ash" -- adding all ZLib functions into the CLI namespace -- I can just type "obtain 1"(enter)"s.o.c.k."(enter)"airship"(enter) and off I go. It's also handy for other things such as resisting cold -- "resist cold"(enter)(enter).

@coaster: I wouldn't call that a fail... your script worked just fine, right? Plus, you learned a lot writing it, I'd wager.

IT was a fail... obtain in zlib does it someone said. this script is a complete fail :| but yes i did learn something

Well, obtain will do the buy as well... so you don't need the check...

Unless there's a reason to try to get two? Outfit a friend?

Thanks for the info :(
 
Last edited:
Not a fail, as it's still useful to know how to do things. You may not always want to be able to adventure for the item... if you have an effect that will wear off, you may want to have it try to buy and bail out after.

What would still be useful would be putting together a script/alias pack that will collect the outfits for you. If you're using zlib to do it, then you can do each as a 2-3 line script... Just import zlib at the top, then make each function be something like obtain_blackarmaments(), obtain_bugbearcostume(), etc. Then, if someone wants to do them, they can use what you've learned. Or, alternatively, you could put together a set of aliases to do them. :)
 
this script is a complete fail :| but yes i did learn something
Thomas Edison via wikiquote said:
"I speak without exaggeration when I say that I have constructed 3,000 different theories in connection with the electric light, each one of them reasonable and apparently likely to be true. Yet only in two cases did my experiments prove the truth of my theory."
"Just because something doesn't do what you planned it to do doesn't mean it's useless."
You learn, you move on ^^
 
Hmm... Might this help? http://kolmafia.us/showthread.php?5239
PHP:
import <zlib.ash>;
string[int,string]outfitset;
string[string,int]catalog;
item[string,int]listing;
file_to_map("outfits.txt",outfitset);
foreach x,name in outfitset{
    catalog[name]=split_string(outfitset[x,name],",");
    foreach y in catalog[name]{
        listing[name,y]=to_item(catalog[name,y]);}}
clear(outfitset); clear(catalog);
int [item] get_outfit_pieces (string outfitname){
    return listing[outfitname];}
The variables can be change up, but that might come in handy. AFAIK, there's no listing in mafia that details the outfit pieces, this should return a map of pieces for each outfit. We would just need loocations then.
 
So, we can pull the outfit pieces from mafia using file_to_map outfits... how much work is it to then do file_to_map monsters and file_to_map combats, look at monsters for the top dropping mob, and then check the locations in combat using canadv to see if it's actually possible to go there? :p Should be easy, right? *coughs* For that matter, making a list of which zones have all the pieces first if possible, then comparing them to canadv to see if we can go there, and if not, try either for bits in various zones or a lower zone if needed (and possible).
 
PHP:
string[int,string]outfitset;
string[string,int]catalog;
item[string,int]listing;
file_to_map("outfits.txt",outfitset);
foreach x,name in outfitset{
	catalog[name]=split_string(outfitset[x,name],",");
	foreach y in catalog[name]{
		listing[name,y]=to_item(catalog[name,y]);}}
clear(outfitset); clear(catalog);

foreach outfitname in listing{
	print("If you want wear this: "+outfitname);
	foreach x in listing[outfitname]{
		print("You'll need a "+listing[outfitname,x],"green");
		foreach critter in $monsters[]{
			foreach treasure,y in item_drops(critter){
				if(treasure==listing[outfitname,x]){
					foreach place in $locations[]{
						foreach z,trapped in get_monsters(place){
							if(trapped==critter) print("You can get one from a "+trapped+" in "+place,"blue");
}}}}}}}
Some tweaking to determine if pieces need to be constructed, such as the furry mask, but other than that, we wouldn't need data files. A sample of the output:
Code:
If you want wear this: Yendorian Finery
[COLOR="Green"]You'll need a cornuthaum[/COLOR]
[COLOR="Blue"]You can get one from a Mind Flayer in Dungeons of Doom[/COLOR]
[COLOR="Green"]You'll need a ring of aggravate monster[/COLOR]
[COLOR="Blue"]You can get one from a Large Kobold in Dungeons of Doom[/COLOR]
[COLOR="Green"]You'll need a vorpal blade[/COLOR]
[COLOR="Blue"]You can get one from a Quantum Mechanic in Dungeons of Doom[/COLOR]
 
Last edited:
So, we can pull the outfit pieces from mafia using file_to_map outfits... how much work is it to then do file_to_map monsters and file_to_map combats, look at monsters for the top dropping mob, and then check the locations in combat using canadv to see if it's actually possible to go there? :p Should be easy, right? *coughs* For that matter, making a list of which zones have all the pieces first if possible, then comparing them to canadv to see if we can go there, and if not, try either for bits in various zones or a lower zone if needed (and possible).

Trust me on this one, you don't want to do a file_to_map() on monsters.txt -- you'd be better off iterating over $monsters[] and calling item_drops_array() on that.
 
Heh. Yeah, I think with what Fluxxdog posted, that should be about the easiest way to do things... something like
Code:
if (!retrieve_item(1, piece) && my_adv() > 0) adv1(place, *, trapped);
should work, right?
 
I am working on single script version of it. This will take a while BUT you guys are right this is a great idea to put it all into one script ;) happy coding
 
Back
Top