PUBG Mobile Killtracker
This code retrieves data from two JSON APIs and displays the status of each player in a table using tkinter.
Screenshot
Diagram
Dependencies
- requests
- json
- tkinter
Installation
- Install Python 3.x
- Install dependencies by running pip install requests json tkinter in the command line
- Download or clone this repository
Usage
- Run the code with python pubg_killtracker.py
- A window will open displaying a table with each player's name and whether they are alive or dead in the game.
How it Works
- Two JSON API URLs are defined.
- The get_json_data function retrieves the JSON data from a given URL.
- The getallinfo and getkillinfo variables are used to retrieve data from the two JSON APIs.
- A tkinter window is created.
- A dictionary is used to store the player status.
- A loop is used to go over each player in the JSON data.
- The is_alive variable is set to True if the player has not been killed and False otherwise.
- The player's information is added to the dictionary, with the team name as the key.
- The tkinter table is created with the team names and player names, and their status is shown in green or grey depending on whether they are alive or dead.
Limitations
- This code only works with the specific JSON API URLs provided in the getallinfo_url and getkillinfo_url variables.
- The table only displays player names and whether they are alive or dead, it does not display other information such as their score or team ranking.
Future Improvements
- Generalize the JSON API URLs so that the code can be used with any JSON API that contains player data.
- Add more information to the table, such as player score or team ranking.
- Add error handling for cases where the JSON API data cannot be retrieved.