Kyrluckechuck / TFT-Bot

Automate Teamfight Tactics (TFT) for token/mission farming. Updated for Set 8.5!
GNU Affero General Public License v3.0
50 stars 7 forks source link

Add configurable timeouts #137

Closed akshualy closed 1 year ago

akshualy commented 1 year ago

Miss Minutes GIF

Description

Addresses one of the tasks in #124. Adds a map to the config with pre-defined timeouts. Leverages enum, so it's as little effort as possible on our side to add more timeout options in the future.

Notes

Fixes an issue where the bot got stuck if the session expires while being in-game. Fixes an issue where we got an error if the match history returns None. Now prints the timer if CTRL+C was pressed. Additionally limits the timer from being printed too many times.

I've also tried adding a fitting gif to follow your fancy PRs :D

akshualy commented 1 year ago

Yeah, a big hit in readability comes from "having" to put almost all of the timeouts into a variable, so we don't have to get it twice to log and use it. I'm not sure of a better way to do this, honestly, other than to wrap each timeout into it's own method, which feels a bit ridiculous lol So I just went with - IMO - readable-ish variable names