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.

Userscript: Number of cards in browser tab. Messages in this topic - RSS

Corran
Corran
Posts: 402

2/25/2016
Over the past six months or so I have been using a tiny userscrip I created to show how many cards are available on the browser tab for Fallen London (I keep the tab open all day).

It's just a simple thing I whipped up for personal use so it has not been tested extensively. So far I haven't had any problems with it but do keep in mind that this, like any addon, could cause bugs.

It might also not be something Failbetter would want to allow, if so, I will remove this post.

There is a much more involved option out there just for Chrome: Chandlery for Fallen London.

I also found this script that uses the same part of the page, I have not tested if both scripts work together: AdvTimers.

The script is a super simple hack; all it does is look at the text under the card deck, once a minute. It will take the text there and put it in the title of the page/tab, replacing the regular title ("Fallen London!"). Should it not be able to find the deck info (because you are in a storylet, another Fallen London tab, etc.) it will display "No deck found!"

To use the script you will need GreaseMonkey for Firefox, Tampermonkey for Chrome, or a similar addon for your browser.

Then all you need to do is create a new script, copying the script below into the editor window.

Below should be the script if the forum will allow the code to be saved:

// ==UserScript==
// @name Fallen London cards
// @namespace localhost
// @include http://fallenlondon.storynexus.com/Gap/*
// @version 1
// @grant none
// ==/UserScript==

setInterval(function() {

if (document.getElementsByClassName("deck-contents-description").length != 0)
{
var Deck = document.getElementsByClassName('deck-contents-description')[0].innerHTML;

var DeckShort = Deck.substr(0, 17);

document.title = DeckShort;
}
else
{
document.title = "No deck found!"
}

}, 60 * 1000); // 60 * 1000 milsec

--
My Fallen London profile
+1 link
Corran
Corran
Posts: 402

6/22/2017
The script is now also available here.
edited by Corran on 6/22/2017

--
My Fallen London profile
0 link
johncmd
johncmd
Posts: 3

4/28/2018
Corran wrote:

document.title = DeckShort;


Note that Chandlery also shows the number of actions available. To show actions we can replace the above line with:

document.title = document.getElementById("infoBarCurrentActions").parentElement.textContent + ":" + DeckShort;
0 link
johncmd
johncmd
Posts: 3

4/28/2018
By the downvote, I that it someone had a problem with the tweak? Not sure what that problem would be, but it might be a bit more robust to instead replace the three lines


}

}, 60 * 1000); // 60 * 1000 milsec


with


}
document.title = document.getElementById("infoBarCurrentActions").parentElement.textContent + ":" + document.title;
}, 60 * 1000); // 60 * 1000 milsec


For example, this should display the number of actions available even if the deck isn't visible.
0 link
Corran
Corran
Posts: 402

6/6/2018
The script has been updated to work with the June 2018 update.

It can still be installed from here.

--
My Fallen London profile
0 link
Corran
Corran
Posts: 402

10/1/2018
I can confirm this still works.

--
My Fallen London profile
+1 link




Powered by Jitbit Forum 8.0.2.0 © 2006-2013 Jitbit Software