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

Use LCU to interact with the client #93

Closed akshualy closed 1 year ago

akshualy commented 1 year ago

LCU or League Client Update is Riot's API to interact with the league client. It allows checking whether a game is in progress, creating lobbies, and accepting queues. The API is exposed to localhost, and the port is in a file called lockfile in the League folder. There's some rough documentation here. We could either use a module like requests or something like lcu-driver (There's a lot more, some of them in the documentation.) This would significantly improve the client flow and solve known issues, such as quick play not remembering the game mode correctly, needing to accept all sorts of pop-up windows, and more. I'd be down to implement this, I just wanted to suggest it in an issue before doing so :)

Kyrluckechuck commented 1 year ago

Thanks for the suggestion! I am very much on board with this idea, and will welcome any MRs even if they are just proof of concepts 😄

I will explore around with this, but if you get something good hooked up that you feel is reliable and polished, I'm more than happy to pull it in.

Kyrluckechuck commented 1 year ago

Would also be worth exploring Willump, which appears to have a few example tutorials and is maintained in parallel as a fork 🤔

akshualy commented 1 year ago

I still need to decide which library to use or if we want one since we probably only need about 5 API requests. Depends on bloat/size. But yeah, I think lcu-driver and Willump are both great candidates.