OutfitCheck.ash: Shows what outfit pieces you're missing

Rinn

Developer
This little informational script will search your inventory/closet/storage etc. for all outfit equipment and print out what pieces you have or are missing:

There are some booleans provided so you can set where the script will search:
Code:
boolean _checkInventory = true;
boolean _checkStorage = true;
boolean _checkDisplay = false;
boolean _checkShop = false;
boolean _checkStash = false;

And a boolean to show where the item was found:
Code:
boolean _showWhere = true;

Source:
Code:
// File:			OutfitCheck.ash
// Author:			Joe Kirchoff
// Character:		Epicgamer
// Created:			9-20-2008
// Last Modified:	9-21-2008
// Description:		This ash script prints out any outfit pieces you may be missing.

boolean _checkInventory = true;
boolean _checkStorage = true;
boolean _checkDisplay = false;
boolean _checkShop = false;
boolean _checkStash = false;

boolean _showWhere = true;

record _outfits {
	string _outfit;
	string[int] _items;
	boolean[int] _found;
	string[int] _where;
};

void OutfitPrint(_outfits[int] outfitMap)
{
	foreach i in outfitMap
	{
		print(outfitMap[i]._outfit);
		foreach j in outfitMap[i]._items
		{
			if (outfitMap[i]._found[j])
			{
				if (_showWhere)
					print("+ [" + outfitMap[i]._where[j] + "] " + outfitMap[i]._items[j], "green");
				else
					print("+ " + outfitMap[i]._items[j], "green");
			}
			else
				print("- " + outfitMap[i]._items[j], "red");
		}
	}
}

_outfits[int] OutfitCheck()
{	
	record {
		string _outfit;
		string _items;
	} [int] outfitStrings;

	file_to_map("outfits.txt", outfitStrings);

	_outfits[int] outfitMap;
	
	foreach i in outfitStrings
	{
		outfitMap[i]._outfit = outfitStrings[i]._outfit;
		outfitMap[i]._items = split_string(outfitStrings[i]._items, ", ");
	}

	foreach i in outfitMap
	{
		foreach j in outfitMap[i]._items
		{
			item check = to_item(outfitMap[i]._items[j]);

			if (_checkInventory && available_amount(check) > 0)
			{
				outfitMap[i]._found[j] = true;
				if (item_amount(check) > 0)
					outfitMap[i]._where[j] = "bag";
				else if (closet_amount(check) > 0)
					outfitMap[i]._where[j] = "closet";
				else
					outfitMap[i]._where[j] = "equipped";
			}
			else if(_checkStorage && storage_amount(check) > 0)
			{
				outfitMap[i]._found[j] = true;
				outfitMap[i]._where[j] = "storage";
			}
			else if(_checkDisplay && display_amount(check) > 0)
			{
				outfitMap[i]._found[j] = true;
				outfitMap[i]._where[j] = "display case";
			}
			else if(_checkShop && shop_amount(check) > 0)
			{
				outfitMap[i]._found[j] = true;
				outfitMap[i]._where[j] = "shop";
			}
			else if(_checkStash && stash_amount(check) > 0)
			{
				outfitMap[i]._found[j] = true;
				outfitMap[i]._where[j] = "clan stash";
			}
		}
	}

	return outfitMap;	
}

void main()
{
	OutfitPrint(OutfitCheck());
}

This script is mostly in preparation for some additional outfit handling scripts (buying missing pieces, pulling an entire outfit from storage) I plan on writing later.
 

Attachments

  • OutfitCheck.ash
    2.3 KB · Views: 106
Top