Checking stuff to autosell

Heyas,

So, I have been looking at Networth.ash and gotten a few ideas, but I'm generally now trying to have a check that will

* run through my whole inventory looking for items where the number of items > 50
* report back via print commands that this is the case
* and perhaps (via some sort of query on the autosell amount for an item) work out how much selling this junk would net. (don't actually want to autosell them, just start to get notified that a large amount of goods are starting to accmulate. That it's time to think about selling or pulverizing them.)

I'm sort of thinking along the lines:
foreach item_name in $items[]
{
if (item_amount($item[item_name]) > 50)
{
print: "You have over 50 " + item_name + "(s)");
print: "They would be worth " + check_worth_of_[item]_somehow + ", if autosold.");
}
}


Once again, I appreciate the help :) Everytime I finish a script I think of a better, more complicated way, to do something the next day...
 
Last edited:

heeheehee

Developer
Staff member
Couple of things -- do you want to sell all of the item?
Also, get_inventory helps with cutting down runtime.

So here's a quick snippet that I whipped up:
Code:
int [item] invent = get_inventory();
int [item] to_sell;
int tot_sell = 0;
foreach i in invent {
   if(invent[i] > 50) {
      to_sell[i] = invent[i];
      print("You have over 50 " + i.to_plural());
      print("Autoselling all of them would net " + autosell_price(i)*invent[i] + " meat.");
      tot_sell = tot_sell + autosell_price(i)*invent[i];
   }
print("Autoselling all of the stuff above would yield a net total of "+tot_sell+" meat.");
}

Edit: Erm, forgot to mention that to_sell is a map that contains the list of the items to autosell. Also finished up the code; I think I submitted it a bit hastily earlier.
 
Last edited:
Top