Fluxxdog
Active member
This little bit of script requires zlib, more for simplicity than anything. If you're interested, I'd like you to try this simple script out and let me know if you have any errors (listed as "Confusion: <outfit name>")
The script is intended to create a map of outfits. In this example, the outfits are parsed and then gone through to see which ones you have and which ones you don't. Should the map conflict with what mafia reports you a having, the Confusion message will pop up. Thanks for any testing you do ^^
(And if you must ask, the whole purpose is to learn some of this script)
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);
foreach name in listing{
boolean flag=true;
foreach x in listing[name]{
if(have_item(listing[name,x])<1 || !can_equip(listing[name,x])) flag=false;}
if(flag) print("You own a "+name+"!");
if(have_outfit(name) != flag){
print("Confusion: "+name,"red");}}
(And if you must ask, the whole purpose is to learn some of this script)
Last edited: