-
-
Notifications
You must be signed in to change notification settings - Fork 120
Game statistics guide
Since July 2022 (Version 6.0) the latest huge addition was game statistics tracking. You can now grab data from different web pages and have them show on your account. Say Apex Legends; you can pull your level and rank from <website>.com/<steamid>
and have them display in-app under your account! It's a great feature, but as it's web scraping I do reach out to websites I use in-app before publically including them.
That being said, you can happily include your own game or stats for any game by editing one text file; GameStats.json
. If you do make changes, please contact me so I can reach out to the website hosts (if not you) to include all users. More details on editing the JSON file can be found in this Wiki article.
In the StatsDefinitions
object, there are multiple game objects. The platform object's key is the game's name. For example, "Apex Legends".
Inside the Platform object, there are required keys and optional keys.
There is also a PlatformCompatibilities
object that tells the account switcher what game from StatsDefinitions
to include on which platform/s.
- UniqueId (String): This is a simple, unique, short string with no special characters to represent the game name.
-
Indicator (String): This shows up just before a stat under an account (Incase X and Y games both have "LVL" stats). This should be short and simple once again but may include special characters. These should be short as they are displayed as
KEY <data>
, as inLVL 17
. If the indicator is not blank, it will display asINDICATOR KEY <data>
, as inAPEX LVL 17
. The indicator text is displayed as a superscript using the HTML<sup>
tag. -
Url (String): This is the main URL to get information from. You can substitute in
Vars
collected from users by adding say{Username}
and defining it later. - RequestCookies (String): Any special cookies that may be required to GET from the URL above.
-
Vars (Object): Each key is a variable name to be used in
Url
above. The value is a placeholder prompt for the user to understand what is asked for. Both should be simple to read, as both are displayed in the modal. For example"Username": "Origin username"
shows asUsername [Origin username_______]
in the GUI (the brackets being a text input field).- This can include special variables. Using
%ACCOUNTID%
grabs the ID for whatever account is currently open. This is limited for now, but more automatic variables can be added in the future.
- This can include special variables. Using
-
Collect (Object): Each key in Object is the name of a stat to show in the switcher. Each key needs some settings inside it, as follows:
-
XPath (XPath String): XPath is a simple string that points the software to an element in HTML. If you've ever used JQuery's
$("selector")
, you likely understand how this works. It's relatively simple, and Selenium have a great guide. The less specific and more accurate you make yours, the more likely it will last through small website changes. For example; prefer.//*[@class='levelNumber']
over/HTML/body/div/div/div/div[1]/span/div/...
. -
Select (String): What to select from the element found using XPath. This can be
innerText
orinnerHtml
depending on your use case. This can also beattribute
, but make sure to setSelectAttribute
. -
SelectAttribute (String): Optional. The type of attribute to collect if
Select
is set toattribute
. This can be set tosrc
for an image link, for example. -
SpecialType (String): This has very limited uses currently. If you add
"SpecialType": "ImageDownload"
, it will attempt to download the attribute value as a file and use it as an image. -
DisplayAs (String): Simple text to display under accounts. Use
%x%
for the data collected. Do keep in mind these will display just after the<sup>{Indicator}</sup>
set above. Once again: keep it short. This can be just%x%
and nothing more. HTML can also be used, for example: Use<img src=\"%x%\" />
if the "stat" you're collecting is an image. -
NoDisplayIf (String): If the DisplayAs text after substitution is the same as this, it won't be displayed. For example:
Lvl 0
set here will not show anything if the requested account is Level 0. -
ToggleText (String): This is used in the modal. Users can toggle on/off specific stats from showing on their accounts. Speaking of, they can also disable specific stats for games globally in the platform's settings - So no "Wins" counter shows, for example. It is downloaded and placed in
wwwroot\\img\\statsCache
.
-
XPath (XPath String): XPath is a simple string that points the software to an element in HTML. If you've ever used JQuery's
API support should be coming at some stage in the future. Essentially you'll swap out XPath for maybe APIPath or something... I will probably use something similar, maybe even XPath? Then you should be able to collect specific stats from an API response easily. All you'd need to do is swap out the URL for an API URL instead.
All trademarks and materials are the property of their respective owners and their licensors. This project is not affiliated with any companies referenced. This is not "Official" software or related to any companies mentioned. All it does is let you move your files around on your computer the same way you can. The use of names, icons and trademarks does not indicate endorsement of the trademark holder by this project or its creators, nor vice versa. They are only used to visually indicate which programs this project interacts with easily to the end-user.
By enabling optional features that scrape the web for publically available information (such as limited game/profile statistics and other data), you understand and accept full responsibility for doing so on your own volition. If you appreciate accurate information, support the services providing it directly. The information collected is incredibly limited and is no replacement or competitor for sites scraped.
I am not responsible for the contents of external links. For the rest of the disclaimer, refer to the License (GNU General Public License v3.0) file: https://github.com/TcNobo/TcNo-Acc-Switcher/blob/master/LICENSE - See sections like 15, 16 and 17, as well as GitHub's 'simplification' at the top of the above website.