Inventory value script

DeletedUser

Hello, here an actual script which gives back the value of your inventory:

Code:
javascript:var sell_value_equipped = 0, equipped = Wear.wear, inventory_value = 0, inventory = Bag.getInstance().items; if($defined(equipped.animal)) sell_value_equipped += equipped.animal.get_sell_price(); if($defined(equipped.body)) sell_value_equipped += equipped.body.get_sell_price(); if($defined(equipped.foot)) sell_value_equipped += equipped.foot.get_sell_price(); if($defined(equipped.head)) sell_value_equipped += equipped.head.get_sell_price(); if($defined(equipped.neck)) sell_value_equipped += equipped.neck.get_sell_price(); if($defined(equipped.right_arm)) sell_value_equipped += equipped.right_arm.get_sell_price(); if($defined(equipped.yield)) sell_value_equipped += equipped.yield.get_sell_price(); for(var p in inventory) {inventory_value += inventory[p].get_sell_price() * inventory[p].get_count_value();} alert("The value of the items in your bag is: " + inventory_value + "$\nThe value of the items you wear is: " + sell_value_equipped + "$\nThe total value is: " + (sell_value_equipped + inventory_value) + "$"); end();
stacked items are correct calculated.

Feel free to use and change the script.

Best regards Glasi.
 

DeletedUser

Works fine, perhaps you should get in touch with weststat's. I'm sure they would be happy to add more to their scripts section.

I think they are following the forum as well. But maybe, if there is no actual script for this on weststats in a few days I would contact them.
 

DeletedUser

We already have a script that does that but good job making it
 

DeletedUser

We already have a script that does that but good job making it

Do u mean here in the forum? Because I did'nt find such script here. And the script on weststats.com does not calculate right because it does stacked items only calculate once and not as often as it is stacked.
 

DeletedUser

Do u mean here in the forum? Because I did'nt find such script here. And the script on weststats.com does not calculate right because it does stacked items only calculate once and not as often as it is stacked.

Hes Right There Gem, it doesn't Calculate Stacked Properly.
 

DeletedUser

Do u mean here in the forum? Because I did'nt find such script here. And the script on weststats.com does not calculate right because it does stacked items only calculate once and not as often as it is stacked.

No no, the import inventory one! :)
Sorry if I didn't make myself clear.
 
Top