Skip to content

Instantly share code, notes, and snippets.

@DamianDominoDavis
Created September 13, 2022 21:23
Show Gist options
  • Save DamianDominoDavis/e2393626c82a250a3b0fca3e6c4a4d76 to your computer and use it in GitHub Desktop.
Save DamianDominoDavis/e2393626c82a250a3b0fca3e6c4a4d76 to your computer and use it in GitHub Desktop.
// display big tradeable items, and big piles of tradeable items
int hmny(item it) {
static int[item] memory;
if (!(memory contains it))
memory[it] = it.available_amount() + it.shop_amount() + it.display_amount();
return memory[it];
}
void main(int show_this_many_treasures) {
// cache and change user preferences
string autoSatisfyWithStash = get_property('autoSatisfyWithStash');
set_property('autoSatisfyWithStash', false);
string autoSatisfyWithCloset = get_property('autoSatisfyWithCloset');
set_property('autoSatisfyWithCloset', true);
string autoSatisfyWithStorage = get_property('autoSatisfyWithStorage');
set_property('autoSatisfyWithStorage', true);
try {
item[int] them;
int total;
foreach it in $items[]
if (it.tradeable && it.hmny() > 0)
them[them.count()] = it;
sort them by -value.historical_price() * value.hmny();
int lines;
for x from 0 to (them.count()-1) {
item it = them[x];
total += it.historical_price() * it.hmny();
if (lines < show_this_many_treasures && it.historical_price() >= 10000 && it.historical_price() * it.hmny() >= 50000)
print(`{(it.historical_price() * it.hmny()).to_string('' + ++lines + ': %,12d')} meat <= ({it.hmny()}) {it} @ {it.historical_price().to_string('%,d')}/ea`);
}
print(`{total.to_string('%,d')} meat as tradeable items in bag, in closet, in shop, on display, or equipped.`);
}
finally {
// restore user preferences
set_property('autoSatisfyWithStash', autoSatisfyWithStash);
set_property('autoSatisfyWithCloset', autoSatisfyWithCloset);
set_property('autoSatisfyWithStorage', autoSatisfyWithStorage);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment