//history.
//v1 by lostcalpolydude, initial functionality
//v2 by mstieler, multiclosetting no longer a thing
//v3 by nworbetan, fancied up
//v4 by Veracity, fixed script not working anymore
//v5 by taltamir, verbosity now has levels, instead of popup you set run/simulate in config, list item mall price if set to verbose, remove pluralization in verbose so you can copy paste it into searchbar without need to start futzing with it.
//v6 by Thok, missing comment caught
//CONFIG START - set your options below
int minimum_value = 5000; // Closet everything stealable worth more than this; 0 = closet everything stealable.
int verbose = 1; //0 = don't print individual items; 1 = print closeted items; 2 = also too cheap to closet; 3 = also unstealable.
boolean go = true; //false to simulate, true to run script.
//CONFIG ENDS
void main()
{
if (minimum_value < 0) abort ("A minimum_value less than zero makes no sense at all.");
int count_cheap, count_closet, count_total, count_unstealable;
int [item] inv = get_inventory();
boolean [item] pvp_unimportant = $items[tenderizing hammer, dramatic range, Queue Du Coq cocktailcrafting kit];
boolean is_stealable(item it) { return is_tradeable(it) && is_discardable(it); }
foreach it, qty in inv {
int price = -1;
if (is_stealable(it) && !(pvp_unimportant contains it)) price = historical_price(it);
if (price < 0)
{
count_unstealable += 1;
if (verbose>=3) print_html("<span color=\"green\">Unstealable: " + qty + " " + it + "</span>");
}
else if (price < minimum_value)
{
count_cheap += 1;
if (verbose>=2) print_html("<span color=\"red\">Don't closet " + qty + " " + it + " @ " + historical_price(it) + " each in the mall.</span>");
}
else if (price >= minimum_value)
{
count_closet += 1;
if (verbose>=1) print_html("<span color=\"teal\">" + (go ? "Closet " : "Simulate closet ") + qty + " " + it + " @ " + historical_price(it) + " each in the mall.</span>");
if (go) put_closet(qty, it);
}
}
count_total = count_closet + count_cheap + count_unstealable;
print(""); //linebreak
if (count_closet > 0) print("+ " + count_closet + (go ? "" : " woulda been") + " closeted", "teal");
if (count_cheap > 0) print("+ " + count_cheap + " worth less than " + minimum_value + " meat", "red");
if (count_unstealable > 0) print("+ " + count_unstealable + " unstealable", "green");
if (count_total > 0) print(" = " + count_total + " of " + count(inv) + " items accounted for.");
print_html("<b>Done! <a href=\"http://kolmafia.us/showthread.php?10059\">discussion thread link</a></b>");
}