coaster3000
Member
Doesn't actually need that check... obtain already checks to see if one is available.
Yes i know that. But i mean for the buy() ^__^ thats all..
Can a mod please move this now thanks
Doesn't actually need that check... obtain already checks to see if one is available.
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.
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?
this script is a complete fail :| but yes i did learn something
You learn, you move on ^^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."
What would still be useful would be putting together a script/alias pack that will collect the outfits for you.
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];}
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");
}}}}}}}
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]
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? 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).