What are you worth? networth.ash will tell you.

dj_d

Member
Quick and dirty script: networth.ash tells you what you're worth. Enjoy!

(And if you're so inclined, show off by posting the results in this thread.)
 

Attachments

Last edited:
Why are you checking the amount of the stash? That doesn't seem to be indicative of what you're worth. Did you mean for that to be a call to storage_amount() rather than stash_amount()?
 
I ran it and here are the results:
> Liquid meat (eww): 2844922
> Total: 969344526

Never thought I was worth that much.
 
Nice simple little script. Just tried it and at first I was shocked by how many items were being tallied that I knew didn't exist in my inventory. I figured that must have been a horrible bug. Then I took a look at the code and realized that my store was also included. Ah! :p

Noted that there were two things I considered problems with this script. First of all, it shouldn't have been reporting my hordes of items that were only worth 0 meat. It was cluttering the useful output with tons of un-tradeables that don't contribute to my net worth. Secondly, you were ignoring the fact that some items can be auto-sold for meat even though they cannot be traded. That's probably not much meat, but it should be considered. Here are my fixes:

Code:
script "networth.ash"
notify "dj_d";

import <zlib.ash>;

boolean use_display = false;

int total = 0;
int i = 0;
foreach it in $items[]
{
  int amount =  available_amount(it) + shop_amount(it) + storage_amount(it);
  if (use_display) amount = amount + display_amount(it);
  if (amount > 0)
  {
    int price = max(0,historical_price(it));
    if ((price == 0) && (is_tradeable(it)))
      price = mall_price(it);
    if ((price == 0) && (autosell_price(it) > 0))
      price = autosell_price(it);
    if (price > 0)
      print(amount+" "+it+" for "+price+" each.");
    price = amount * price;
    total = total + price;
  }
}
print("Liquid meat (eww): "+to_string(my_meat() + my_closet_meat()));
print("Total: "+total);

Liquid meat (eww): 1197413
Total: 157925668

Compared to asturia I'm poor, despite my years of play. Ah, hardcore, you are a cruel master who banishes all my meat into my terrarium. Or maybe I just spent all my meat trying to get a larger pile of stuffed Hodgmen. ;)
 
Last edited:
apprently i'm in considerable debt....

Liquid meat (eww): 11978
Total: -926311209

Probably because i'm in ronin!
 
Last edited:
Updated - great changes, Bale.

Matt, I have no idea what your bug is. Do you report any items with 999999999 value? You may be so rich you're overflowing maxint. :) Can float hold a bigger number than maxint?
 
I think spooky putty ball came up as 999999998 however wouldn't it just throw an overflow exception ?

i'll have a look later!
 
I haven't run networth.ash, but I was looking at Bale's blip of code last night and started wondering... does this script look at meat in Hagnk's? My first thought was no, so on the chance that it doesn't... you're welcome to snag what you need from this function and include it:

Code:
int my_storage_meat() {
	string storage = visit_url("storage.php");
	string storagemeat = substring(storage, index_of(storage,"have "), index_of(storage," meat"));
	return to_int(storagemeat);
}

print("Meat on hand: " + my_meat(), "#33CCCC");
print("Meat in closet: " + my_closet_meat(), "#33CCCC");
print("Meat in Hagnk's: " + my_storage_meat(), "#33CCCC");
print("My total meat: " + to_string(my_meat() + my_closet_meat() + my_storage_meat()), "green");
 
Ugh, I feel dirty for using this dirty script...

Liquid meat (eww): 1596549
Total: 1287216834

Actually that's more like ~295mil, spooky putty mitre got picked up as 999,999,998.

One change I made was a use_shop bit. I don't put things in my mall very often and it runs about a million times faster for me without having to check my store for each item I have.

Nifty little script, RIP pricegun.js though :(
 
Last edited:
Liquid meat (eww): 76523
Total: -1234379164

- That's my meat on hand, not counting the meat in storage.
- I don't know which items I have worth 999,999,999, but I must have some...

Perhaps you could save a map of 999,999,999 items and not tally them and report them later?

You also might enjoy my commified number printer, from my mmg-utilities.ash.
 
So much for a quick and dirty script. :)

I went and spent a bunch of time figuring out the joys of arrays and sorting them... the output is now sorted with the items that are most valuable (as a group) at the bottom, comma printed. And taking hagnk's into account. Enjoy!
 
I'm jealous. Spiny and Veracity got commented credit, but my additions are anonymous. :(

It's looking rather nice now. There's something to be said for quick-n-dirty though. It lacks that charm now that it's so polished.
 
Since we're getting all polished-like ...

You have 14376 dense meat stack worth 2,000 each for a total of 28,752,000

Also, too bad this wasn't entered in the PriceGun contest I ran a couple of months ago :) Although we (the KoL population) did get a pair of superb greasemonkey scripts out of the deal!
 
@Bale: That's fair... there's three reasons I didn't, none of which are particularly good.

  • I consider the thread as the place to say "thank you". I consider the comments the place to provide credit for what would otherwise be plagarism. So I will say "thank you" in the thread for help, but usually only put something in the comments if I copy a large portion of a function exactly - usually, the function is my "unit of recognition".
  • At this point, I assume that anything I release has been rewritten significantly by you or Zarqon. It's just a given. He's AWOL from this thread, oddly enough.
  • I forgot.

Fixed. :)
 
Back
Top