Powered by Jitbit .Net Forum free trial version.

HomeFallen London » The Bazaar

This is the place to discuss playing the game. Find tips, debate the best places to find certain items and share advice.

The echo worth of all items one owns Messages in this topic - RSS

MittenO
MittenO
Posts: 9

3/19/2014
As far as I can see,
there is no easy way to figure out the total echo worth of all ones possessions.
So I tried to calculate it with a calculator. That got old real fast.
Therefore I made this code snippet.


var prices = $("li.shop-item").find("span.price").map(function(index,el){
if($(el).hasClass("currency-echo")){
return parseFloat(el.innerHTML);
}else{
return 0;
}
});
var quantities = $("li.shop-item").find("div.item-quantity").map(function(index,el){return parseInt(el.innerHTML);});

var sum = 0.0;

for(var index = 0; index < prices.length ; index++){
sum += prices[index]*quantities[index];
}

console.log("Total echoes:" + sum);


Just open the "sell my things"-tab in the bazaar tab,
pop that into the javascript console of your browser,
(F12 in firefox) and press enter.

Do note that I have no actual proof that this is correct,
but the number it gives for me (35476.01) seems plausible,
since I have seven pages of stuff and counting the first page with a calculator gave me
about 6000.
YMMV.

Feel free to point some extremely easy way
to do this without JS shenanigans or otherwise comment on the matter.
Perhaps share your total?

EDIT: Fixed bug with non-echo sellables noticed by Martial Canterel. Now ignores them, so the total is somewhat below your actual worth. Would be too much work to cross-reference the values for those that sell for items.
EDIT2: Fixed bug in bugfix.

PS. Tested with Chrome, poor alt, hand calculation. Seems to work.
edited by MittenO on 3/20/2014
edited by MittenO on 3/20/2014
+16 link
Worthstream
Worthstream
Posts: 9

3/20/2014
Woohoo! I'm really rich: 920 echoes.

Maybe i'm not that rich, after all.

--
In the fallen City i'm known as Worthstream
+4 link
Locrian
Locrian
Posts: 31

3/21/2014
14,291 Echoes. Apparently I could get my second overgoat right now if I sold my first one. This sounds like an excellent idea.

--
Locrian, the Genial Promethean
Dorian, the Implacable Hedonist
Aeolian, the Gentle Cypher
Lydian, the Boisterous Brawler
+4 link
MittenO
MittenO
Posts: 9

3/20/2014
Aand thank to this script I realized,
that with much weeping and gnashing of teeth,
I could afford an overgoat!

So I bought one!
Woohoo!
http://fallenlondon.storynexus.com/Profile/HaapaPuu
+3 link
Kade Carrion (an_ocelot)
Kade Carrion (an_ocelot)
Posts: 1372

3/20/2014
Shadowhand wrote:
I wasn't even aware that the cider auction was over! In what thread may I find discussions regarding NiteBrite's ensuing immortality shenanigans?


Here.

--
Social Actions: send them to Kade Carrion (she/her; no Tournament of Lilies, please). an_ocelot has gone NORTH and cannot benefit from social actions!

Possibly-Useful Things: Spreadsheets and hints and link collections, oh my.
+2 link
Kade Carrion (an_ocelot)
Kade Carrion (an_ocelot)
Posts: 1372

12/6/2015
Since this has been necro'ed, a simpler way to do this is here: http://community.failbettergames.com/topic9501-goat-farmers-browser-extension.aspx#post75797

(And Grenem I think that's an artifact of the floating-point system used to represent numbers in computers, which I only know because I asked about a similar thing once.)

--
Social Actions: send them to Kade Carrion (she/her; no Tournament of Lilies, please). an_ocelot has gone NORTH and cannot benefit from social actions!

Possibly-Useful Things: Spreadsheets and hints and link collections, oh my.
+2 link
Raymond Price
Raymond Price
Posts: 48

3/21/2014
I have about E5800, plus another E1300 in the bank. I need to get grinding.
ETA: Of course, as others have noted, a lot of those items are things I'd best not sell because they're more useful to me than the echoes they're worth. Stat/BDR equipment, trade goods, rostygold for buying connections and whispered secrets for buying expedition supplies, or Favours to turn into MW.
Playersideblog wrote:
I haven't dabbled in JS for ages; would there be a way to cut off items above a certain cost threshold, in case (for instance) I wanted to exclude things like my Dreadful Surmise?
This worked for me. Sorry for the crap formatting, but I added a ternary expression in the price scraper that only returns prices less than 300.
ETA: Because I could, I wrote a new and improved version. Regrettably, I couldn't do it all on one line because jQuery doesn't have a native reduce function. I did include the exclude-ridiculously-expensive-items check, though.
$.fn.reduce = [].reduce;
$("li.shop-item").reduce(function(accumulator, item) {
var price = parseFloat( $(item).find("span.price.currency-echo").text()|| 0);
price = (price > 300) ? 0: price;
var quantity = parseInt($(item).find("div.item-quantity").text() || 0);
var title = $(item).find(".item-details h6").text();
var worth = price * quantity;

//console.log(title + "=>" + worth);
return accumulator + worth;
}, 0);

edited by Raymond R Price on 3/22/2014

--
http://fallenlondon.storynexus.com/Profile/Raymond~R~Price
Up for any and all social actions, including
* Menace Reductions * Newspaper Interviews
* Tournament of Lilies * Affluent Photographer
** I also have Parabolan Kittens **
+2 link
Raymond Price
Raymond Price
Posts: 48

3/22/2014
Improved it again. Now it also tallies the echoes you have in the bank.
$.fn.reduce = [].reduce;
$("li.shop-item").reduce(function(accumulator, item) {
var price = parseFloat( $(item).find("span.price.currency-echo").text()|| 0);
price = (price > 300) ? 0: price;
var quantity = parseInt($(item).find("div.item-quantity").text() || 0);
var title = $(item).find(".item-details h6").text();
var worth = price * quantity;

//console.log(title + "=>" + worth);
return accumulator + worth;
}, 0)
+ parseFloat($(".you_lhs span.currency-echo").text());

--
http://fallenlondon.storynexus.com/Profile/Raymond~R~Price
Up for any and all social actions, including
* Menace Reductions * Newspaper Interviews
* Tournament of Lilies * Affluent Photographer
** I also have Parabolan Kittens **
+2 link
Kade Carrion (an_ocelot)
Kade Carrion (an_ocelot)
Posts: 1372

3/20/2014
NiteBrite, I think it both hilarious and terrifying that you can sell the Cider. I would be so, so paranoid about that.

--
Social Actions: send them to Kade Carrion (she/her; no Tournament of Lilies, please). an_ocelot has gone NORTH and cannot benefit from social actions!

Possibly-Useful Things: Spreadsheets and hints and link collections, oh my.
+2 link
mayexist
mayexist
Posts: 132

3/20/2014
Very useful, thank you!

(Ctrl+Shift+J for quick access to the console in Chrome.)

--
+2 link
NiteBrite
NiteBrite
Posts: 1019

3/20/2014
Without Cider: 23016.47 echos, With Cider 103016.47 echos. Almost everything I own would be a terrible idea to sell though.

--
I AM currently accepting calling cards.
Stats loss counter: reset, irrigo equivalent: none
[00:34] <@ortab> NiteBrite's laugh is that of a condemned soul gazing into the abyss.
Merciless Modiste avatar by Paul Arendt (based on an original image by Joe England)
http://fallenlondon.storynexus.com/Profile/TheBriteModiste
+2 link
Shadowhand
Shadowhand
Posts: 197

3/20/2014
I wasn't even aware that the cider auction was over! In what thread may I find discussions regarding NiteBrite's ensuing immortality shenanigans?

--
Twitter: @mortshadow - Fallen London: Shadowhand

Benjamin Gabbay, a silly and crafty individual of mysterious and indistinct intentions
+1 link
Sackville
Sackville
Posts: 295

3/26/2014
I've added a quick hack to Raymond's work that includes a list of items you don't want to sell, regardless of price. I've already included all the high-end bazaar gear and a few other things that are unique or difficult to acquire that I figured would be popular to exclude, but you can throw anything else you're attached to into the array. I've surely forgotten some things, or you might want to remove something you're grinding to turn into a collectible or PoSI item. When I ran it, for example, I excluded enigmas, cellars, and airag since they're earmarked for an Impossible Theorem and M_____'s B___d, which left me with just over 8k in saleable items.

$.fn.reduce = [].reduce;

//Array of items you don't want to sell
var nosale = ["Semiotic Monocle", "Gloam-Foam", "Snuffer's Face", "Sneak-Thief's Mask", "Devilish Fedora", "Fecund Amber Tiara", "Smock of Four Thousand Three Hundred and Eight Pockets", "Moderately Co-operative Clothes Colony", "Academic Gown", "Ratskin Suit", "Far Khanate Lacquered Armour", "Exquisite Ivory Gown", "Sumptuous Dandy's Outfit", "Insatiable Glove", "Lenguals", "Spiderchitin Gauntlets", "Twelve-carat Diamond Ring", "Ratwork Watch", "Poison-tipped Umbrella", "Infernal Sharpshooter's Rifle", "Irresistible Drum", "Forgotten Spidersilk Slippers", "Kingscale Boots", "Vakeskin Boots", "Masterwork Dancing Slippers", "Overgoat", "Haunted-looking Dog", "Salt Weasel", "Bifurcated Owl", "Rattus Faber Bandit-Chief", "Rubbery Associate", "Rubbery Conspirator", "Silent Soul"];

$("li.shop-item").reduce(function(accumulator, item) {

var title = $(item).find(".item-details h6").text();
var price = parseFloat( $(item).find("span.price.currency-echo").text()|| 0);

price = (price > 300) ? 0: price;
price = (nosale.indexOf(title.trim()) == -1) ? price: 0;

var quantity = parseInt($(item).find("div.item-quantity").text() || 0);
var worth = price * quantity;

//console.log(title + "=>" + worth);
return accumulator + worth;
}, 0)
+ parseFloat($(".you_lhs span.currency-echo").text());
+1 link




Powered by Jitbit Forum 8.0.2.0 © 2006-2013 Jitbit Software