The program GameTracker tracks the League of Legends matches of a given user. The performance of each match is evaluated. Based on the computed score of the performance, a Telegram bot will automatically send a message to the user.
Use case: Track your friend's matches and automatically send some friendly banter if they don't have good performances.
The main goal of this project was for me to practice my newly acquired Kotlin skills.
Note: The program runs on Windows and UNIX-based systems.
- Add the Telegram bot to a Telegram chat. Find out the
chatId
of the chat. One way to do this is to invite the bot "@getidsbot" to the chat. - Create the file
config.properties
undersrc/main/resources
. The file example/config.properties shows you which properties need to be provided.
Warning: Make sure to capitalize the property values correctly and remove any trailing whitespaces. - From the root directory of the project run
gradlew uberJar
(or./gradlew uberJar
on a UNIX-based system). - Run
java -jar build\libs\GameTracker-1.0.jar
(orjava -jar build/libs/GameTracker-1.0.jar
on a UNIX-based system).
- The program periodically fetches the new match history from the League of Legends API server. If it finds any new matches that fit the performance criteria (e.g., poor performance), it sends a Telegram message. After that, the program sleeps until it fetches the new match history again.
- The program stores the match history it previously fetched in files. That means even if it is shut down, it knows where to start once it is launched again. This would make it a good candidate for a cron job.
- The program only ever sends a message for 1 game after fetching the new match history. This is to avoid spamming the chats.
- Performance evaluation of a match: The program considers 3 main aspects to assess the performance of a user in a
match:
- Did the team win?
- Did the user have good statistics (kills, deaths, assists, etc.)?
- How good are the user's statistics compared to the player on the opposing team that played the same position? (Who got more kills? Who earned more gold? etc.)