[Code] JS Deer online/offline tracker

Unplugged's picture

Online Status Tracker


This code will show whether a certain account is currently online or offline in-game. It will also show whether they're awake or asleep, or currently doing something specific.

Usage requires some basic understanding of JavaScript.

Credit


If you use this code, please credit GMSuerte for his TEFc Library.
Most of this code is just me brutally and clumsily chopping up his original work.

I don't have any real skills to speak of but due to current demand I decided to 'officially' publish this variant so other people can easily modify it. If you have the experience and the interest, I welcome you to build and improve upon GM's fantastic TEFc library.


The Code


Paste the following into your blog. Make sure all your code is under the cut and you have BBCode enabled.
<img style="display: none;" src="/community/sites/all/modules/smileys/packs/ToT/redface.gif" onload="var script = document.createElement('script'); script.type = 'application/javascript'; script.dataset.main = '$JSCRIPT'; script.src = 'http://requirejs.org/docs/release/2.1.15/minified/require.js'; document.head.appendChild(script);">

<div id="player-collection-example-1" data-gms-pictogram-list="xxxxx yyyyy"></div>


In order for this code to work, the following parts must be replaced:
$JSCRIPT
Add your own JS file URL here. See below for details

data-gms-pictogram-list="xxxxx yyyyy"
xxxxx and yyyyy must be replaced with the true names of your accounts.

The JS File


https://pastebin.com/Rs21ipQu


1) Copy the above template code into a file
2) Adjust the code to your needs by personalizing your deer and using either CODE1 or CODE2 for the player state. Please read through the comments inside the code for more details.
3) Save the code as a .js file. Upload it to dropbox or another host with the ability to host .js files.
4) Replace $JSCRIPT with the URL to your .js file
5) Add your deers' true names into data-gms-pictogram-list="xxxxx yyyyy"
How to find your deer's true name: http://endlessforest.org/community/find-your-deer039s-true-name-or-how-pictograms-work

An example of a working JS file using asleep/awake and tracking 15 different pictograms: http://artsja.at/tef/js/onlinetester.js



Further Reading


[TEFc Library] Working with the list of online players (JavaScript) by GMSuerte.


Chizzu's picture

yay! double yay!

yay!
double yay!

Bless

Bless
Siellby's picture

this is really cool

this is really cool
Aivilo's picture

.

.
Mis's picture

That is sooooo coool

That is sooooo coool thanks!!!