Xmas 19 Event Tool: Advanced Stats - v2 released

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

Xmas 19 Event Tool: Advanced Stats - v2 released

#1 Post by ghostiyra » 02 Jan 2020 21:19

Hello,

I created a small script that can be run on the homepage of the World of Trucks website that shows a few more stats for the current event.

It allows showing and hiding of the advanced stats and also showing and hiding completed cities.

It adds 3 progress bars, which are for global stars, europe stars, and america stars.
Here is a preview:
Image

The stats are updated at the same interval that the base stats are (it just uses the data that is fetched from the server every few seconds by the page already)

I assure there is nothing fishy in the script, it is pretty straightforward to follow it if you want to read through all the code.


There's a few options for using the script:

1: You can open the browser's dev tools (usually f12) and paste it in the console, although this needs to be done every time you reload the homepage.

2: Using the Tapermonkey extension for you browser: http://www.tampermonkey.net/ (extension for Chrome, Firefox, Edge, etc)
- For this option, install the extension, then come back here and open the link for the script below in a new tab. Tapermonkey should automatically detect the script and show you an install screen.
- Now everytime you load the homepage of World of Trucks, the script will automatically run.

Here is the script, same link for either usage option:
https://gist.github.com/LyraGhost/09fe4 ... 19.user.js

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

Let me know what you all think.
Should be useful for getting more cities complete.

I will also probably create scripts similar to this for other events in the future should we find them useful.

Edit 05/01/2020:
Update v2:
  • Made expanding the city lists its own option/button
  • Added a loading message while waiting for the data to show the script is actually running
  • Advanced stats are now shown by default
  • Added options to sort city lists by number of remaining deliveries
  • Added country and dlc info to each city (hover over city name)
  • Fixed tapermonkey settings for loading page with and without www.
The link above has been updated with the new script, just click it again to get the update.
(Preview image has also been updated)
Last edited by ghostiyra on 05 Jan 2020 19:18, edited 5 times in total.

d4nn
Posts: 134
Joined: 05 Jan 2019 13:06
Location: Portugal
Contact:

Re: Xmas 19 Event Tool: Advanced Stats

#2 Post by d4nn » 02 Jan 2020 22:54

That is awesome! I love stats

User avatar
Harven
Beta tester
Posts: 996
Joined: 29 Sep 2016 10:24
Location: 127.0.0.1
Contact:

Re: Xmas 19 Event Tool: Advanced Stats

#3 Post by Harven » 03 Jan 2020 21:15

Good idea! Would be nice if you could add an option to sort the cities by number of deliveries (without grouping by country/state).
Image

User avatar
otherguy136
Posts: 142
Joined: 03 May 2019 21:03
Location: Phila, Pennsylvania, USA
Contact:

Re: Xmas 19 Event Tool: Advanced Stats

#4 Post by otherguy136 » 03 Jan 2020 23:00

Is it possible to make this as a Chrome extension, so it automatically adds this every time you open the page?
Discord: OtherGuy#4847 https://discord.gg/2wJRVdr

User avatar
ghostiyra
Posts: 6
Joined: 02 Jan 2020 21:10
Location: Canada
Contact:

Re: Xmas 19 Event Tool: Advanced Stats

#5 Post by ghostiyra » 04 Jan 2020 04:34

I dont really know about making it a chrome extension on its own, but you can set it up with the tapermonkey extension as a user script so it loads every time you load the page.

The extension is available for Chrome, Firefox, Edge, etc:
http://www.tampermonkey.net/

Once the extension is installed and working, simply open the following link and tapermonkey should detect the script and show you an install screen.
https://gist.github.com/LyraGhost/09fe4 ... 19.user.js

I will include all this information in the original post as well.

Thanks
Harven wrote:
03 Jan 2020 21:15
Good idea! Would be nice if you could add an option to sort the cities by number of deliveries (without grouping by country/state).
I will look into adding this in in the morning. Ill update here if i make any progress on that.

User avatar
otherguy136
Posts: 142
Joined: 03 May 2019 21:03
Location: Phila, Pennsylvania, USA
Contact:

Re: Xmas 19 Event Tool: Advanced Stats

#6 Post by otherguy136 » 04 Jan 2020 18:27

A few things I found when using this:
  1. The script is set to work on https://www.worldoftrucks.com/en/, not https://worldoftrucks.com/en/. For me, typing worldoftrucks leads me to the site without www., meaning I have to manually add www. to the url, or remove it from the script.
  2. The script generally takes a few seconds to load after the page itself loads. I tried it on Microsoft Edge and Microsoft Chrome.
  3. I think the Show advanced stats toggle should be on by default.
  4. When advanced stats are shown, the list of cities ignores the scroll bar and makes the whole page much longer. This happens with and without completed cities hidden.
  5. It would probably be a good idea, if possible, to show which cities require which DLC (though this may be difficult because, for example, some French and Italian cities do not require their respective DLCs).
Discord: OtherGuy#4847 https://discord.gg/2wJRVdr

User avatar
ghostiyra
Posts: 6
Joined: 02 Jan 2020 21:10
Location: Canada
Contact:

Re: Xmas 19 Event Tool: Advanced Stats

#7 Post by ghostiyra » 04 Jan 2020 22:49

otherguy136 wrote:
04 Jan 2020 18:27
A few things I found when using this:
...
Im currently working on some updates, including sorting, so i will include those changes as well.

1. This was an oversight on my part, chrome was hiding the www part in my address bar and i hadnt noticed when i imported it to a userscript for tapermonkey.
2. This is due to the fact that the script needs to wait for the page to make a call to refresh the stats to be able to get the data, which is usually 5-10 seconds after page load. All the changes are applied when the page loads, but not shown until the data is received. I've already implemented a loading message where the buttons are that will be in the update.
3. I agree, not exactly sure why i didnt do this lmao.
4. This was mainly done for myself, i found it easier to see both lists expanded, but ill separate that into it's own option.
5. Ill manually add this in as I'm already going to be adding the country name to the cities in sorting mode.

Thank you for your comments to help improve the script, it's very much appreciated and I'm glad others are using it :D

User avatar
ghostiyra
Posts: 6
Joined: 02 Jan 2020 21:10
Location: Canada
Contact:

Re: Xmas 19 Event Tool: Advanced Stats - Version 2 released

#8 Post by ghostiyra » 05 Jan 2020 19:16

Update v2:

I've updated the script with the following changes:
  • Made expanding the city lists its own option/button
  • Added a loading message while waiting for the data to show the script is actually running
  • Advanced stats are now shown by default
  • Added options to sort city lists by number of remaining deliveries
  • Added country and dlc info to each city (hover over city name)
  • Fixed tapermonkey settings for loading page with and without www.
Updated script (click the link to update if you installed via tapermonkey):
https://gist.github.com/LyraGhost/09fe4 ... 19.user.js

Thanks

User avatar
Mohegan13
Global moderator
Posts: 19514
Joined: 05 Jul 2013 09:44
Location: West Yorkshire; Mars
Contact:

Re: Xmas 19 Event Tool: Advanced Stats - v2 released

#9 Post by Mohegan13 » 07 Jan 2020 14:41

Just wondering, would it be possible to add an option to the cities that are "maxed" to see the actual total number of jobs taken from them?
Image
I reserve the right to be 100% wrong.
But on my tombstone when I go, just put 'death by rock and roll'.

User avatar
ghostiyra
Posts: 6
Joined: 02 Jan 2020 21:10
Location: Canada
Contact:

Re: Xmas 19 Event Tool: Advanced Stats - v2 released

#10 Post by ghostiyra » 08 Jan 2020 00:25

I myself was hoping the would be a way to see this, but unfortunately I can't make that happen with the data I have to work with. Here's a snippet of data for 2 cities, 1 complete and 1 not:

Code: Select all

    "liege":{
     "current":"MAX",
     "max":"MAX",
     "percentage":100,
     "graphics":"5"
    },
    "burgas":{
     "current":"623",
     "max":"1,000",
     "percentage":62,
     "graphics":"1"
    },
current and max are used for the numbers,
percentage is to used to set the size of the orange bar progress,
and graphics is the number of stars it currently has.
Last edited by Mohegan13 on 08 Jan 2020 10:19, edited 1 time in total.
Reason: Quote Removed - Don't quote the post directly above.

Post Reply

Return to “WORLD OF TRUCKS website”

Who is online

Users browsing this forum: No registered users and 2 guests