Xmas 2020 Event addon: Advanced Stats, Sorting, and more!

Post Reply
User avatar
ghostiyra
Posts: 7
Joined: 02 Jan 2020 21:10
Location: Canada
Contact:

Xmas 2020 Event addon: Advanced Stats, Sorting, and more!

#1 Post by ghostiyra » 19 Dec 2020 02:02

Hey there,

So a few of you might remember the addon I created for the WoT website for last year's Xmas event (thread here).
This is an updated version of that addon to work with this year's event (2020).

This is an addon tool for the Xmas event section on the WoT website homepage.

Features:

Advanced Stats
More progress bars to show total amount of hearts/gifts for each game, and how close they are from being completed.

City Sorting
Buttons added to both game columns to sort all the cities by:
  • City name
  • Remaining hearts needed (closest to completion on top)
  • Remaining gifts needed (closest to completion on top)
Other Stuff
  • Button to toggle visibility of advanced stats.
  • Button to show/hide all completed cities from both games.
  • Button to expand/collapse the size of the game city lists (makes them really long so theres no scrollbar)
  • Additional data shown when hovering over city names (DLC, Country/State)

Preview:
Image


How it works:
Note: No personal data is transmitted, accessed, and/or modified in this addon. The only data it sees and touches is the number of deliveries for each city.

The WoT website fetches updated data for the event every 10 seconds (if you keep the page open), then updates the main progress bar and the number of hearts/gifts for all the cities.
The addon is setup to also receive this data, which is then parsed, sorted, and some calculations are made, after which all the advanced stats that it adds get updated.

The script starts running when the page is loaded, but needs to wait for the site to fetch updated data (usually about 10 seconds after the page is loaded) before it displays all the advanced stuff and buttons.
There's not really a way I can get around this, as I don't have access to the data until that first fetch (the data displayed on page load is rendered by the server, not by a script).


Using the addon:
There's a couple different ways to run the script.

1: (Recommended) Using the Tapermonkey extension for your browser. https://www.tampermonkey.net (available for Chrome, Firefox, Edge, etc)
  • Install the stable release of Tapermonkey for whichever browser you want to use.
  • Once installed, come back to this page.
  • Open the link to the script below (see "The Script") in a new tab (or current tab, im not your boss ¯\_(ツ)_/¯ )
  • Tapermonkey should detect the script and show you an install screen (with the source code also displayed).
  • Once the script is added, refresh the World of Trucks homepage, and it should start working it's magic.
(if you still have the script from last year installed, disable it in the Tapermonkey dashboard)

2: (Advanced, not recommended) Paste the script into the developer tools console. (You'll need to paste in the code each time you reload the page for this option)
  • Open the SOURCE CODE link for the script below (see "The Script").
  • Copy everything that is shown in the code preview (where it has line numbers).
  • Go to the World of Trucks website and open your browser's inspector/developer tools.
  • In the console tab, paste the code in, and hit Enter.

The Script TM
Install with Tapermonkey:
https://gist.github.com/LyraGhost/d6904 ... 20.user.js
Source Code:
https://gist.github.com/LyraGhost/d6904 ... 7c5abccd5c

Tested on latest version of chrome, but should work in firefox and edge aswell.

Why did I make this?
Last year, nearing the end of the event, I wanted an easier way to see what cities still had deliveries left to do.
That's it.
Then I added extra features because I was bored lol.


If there's any other features anyone wants to see, please let me know and I'll see what I can do.

User avatar
Fiona
Posts: 12
Joined: 08 Jan 2020 18:37
Location: Germany
Contact:

Re: Xmas 2020 Event addon: Advanced Stats, Sorting, and more!

#2 Post by Fiona » 20 Dec 2020 08:52

Programming this must have been a lot of work. I will download and check it out.
Many thanks for the addon and merry christmas to you. :)

User avatar
zippe
Posts: 2574
Joined: 28 May 2016 17:12
Location: Austria
Contact:

Re: Xmas 2020 Event addon: Advanced Stats, Sorting, and more!

#3 Post by zippe » 20 Dec 2020 16:07

cool addon! :)

I liked it a lot last year, thank you for doing it again for this event :)

User avatar
kingoko
Posts: 234
Joined: 06 Nov 2018 18:13

Re: Xmas 2020 Event addon: Advanced Stats, Sorting, and more!

#4 Post by kingoko » 18 Jan 2021 17:37

Is it possible to check how many stars and gifts we completed as community at the end of event?
Click here to check my profile :arrow:
No mods, no cheats, no console :P

ETS2: lvl127, achiev: 62/75, dlc 63/72, steam items 79/83
ATS: lvl84, achiev: 69/70, dlc 23/23, steam items 52/53

Post Reply

Return to “WORLD OF TRUCKS website”

Who is online

Users browsing this forum: No registered users and 1 guest