nworbetan
Member
I added a few embellishments:
The first time you run it, use any argument other than "go" and it'll do a dry run so you can see whether you like the verbosity and/or 1000 meat setting. Setting verbosity to false hides the unstealable and cheap items, but it will always show the closeted items and the brief report at the end.
I think it might be worth adding this functionality to an autoselling script, or vice versa.
Code:
int minimum_value = 1000; // Closet everything stealable worth more than this; 0 = closet everything stealable.
boolean verbose = true; // false = Only print the items that gonna be or woulda been closeted.
void main(string show_or_go)
{
boolean go = (show_or_go.to_lower_case() == "go"); // Anything other than "go" = just show what woulda happened.
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) && autosell_price(it) > 0; }
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) print_html("<span color=\"green\">Not closeting " + qty + " " + (qty == 1 ? to_string(it) + ", it's" : to_plural(it) + ", they're") + " unstealable.</span>");
} else if (price >= minimum_value) {
count_closet += 1;
print_html("<span color=\"teal\">" + (go ? "Gonna closet " : "Woulda closeted ") + qty + " " + (qty == 1 ? to_string(it) : to_plural(it)) + ".</span>");
if (go) put_closet(qty, it);
} else if (price < minimum_value) {
count_cheap += 1;
if (verbose) print_html("<span color=\"red\">Not worth closeting " + qty + " " + (qty == 1 ? to_string(it) : to_plural(it)) + ".</span>");
}
}
count_total = count_closet + count_cheap + count_unstealable;
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\">!</a></b>");
}
I think it might be worth adding this functionality to an autoselling script, or vice versa.
Attachments
Last edited: