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

Post Reply
ghostiyra
Posts: 9
Joined: 02 Jan 2020 21:10
Location: Canada
Contact:

[old] 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:
[ external 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.
Last edited by ghostiyra on 15 Dec 2022 23:31, edited 1 time in total.
User avatar
Fiona
Posts: 11
Joined: 08 Jan 2020 18:37
Location: Germany

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

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

...
Last edited by Fiona on 20 Aug 2021 11:22, edited 1 time in total.
User avatar
zippe
Posts: 2438
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: 209
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: lvl136, achiev: 63/75, dlc 63/72, steam items 79/83
ATS: lvl86, achiev: 70/70, dlc 23/23, steam items 52/53
User avatar
Bandit & The Snowman
Posts: 3232
Joined: 23 Oct 2014 15:55
Location: East Bound and Down
Contact:

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

#5 Post by Bandit & The Snowman » 16 Dec 2021 16:22

Since @ghostiyra isn't currently active, I wonder if there's anyone with some nice JS knowledge who could upgrade his script to the 2021 event?
ghostiyra
Posts: 9
Joined: 02 Jan 2020 21:10
Location: Canada
Contact:

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

#6 Post by ghostiyra » 16 Dec 2021 22:14

Hey there, just now saw the update for this years xmas event, so getting right to work updating the script.
I'll make a new thread/update this one once it is ready!
User avatar
Bandit & The Snowman
Posts: 3232
Joined: 23 Oct 2014 15:55
Location: East Bound and Down
Contact:

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

#7 Post by Bandit & The Snowman » 17 Dec 2021 00:07

Thank you very much :)
Post Reply

Return to “WORLD OF TRUCKS”

Who is online

Users browsing this forum: No registered users and 1 guest