DorskFR / LeaguePyBot

A Python computer vision bot for League Of Legends

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows object detection

UsernameLuxi opened this issue · comments

commented

So I know that it's not working for windows right now, but I tested it on windows.

My experiences are that when League of Legends is in fullscreen, the bot move correctly to the tower position, but when in window/borderless it doesn't do it.

When in fullscreen the object detection doesn't work, but when in the other 2 modes, it will work perfectly fine.
I am wondering if you are working on a fix for this? Or if not, what macos do you recommend for me to use instead so the bot works?

Also, how would I implement auto confirming/claiming champions on level ups, because right now the bot will not press out of it, and it will end the loop of starting games.

Thanks!

commented

Something to add;
when a game is done, and a level up has appeared and therefore a screen with new features comes up, it doesn't move on UNLESS i refocus the league client by clicking on it.

Hello!

This is purely a learning project for me, not something I maintain or anything, so while I might revisit it someday if I want to try new things, there's a high chance it will just remain in this state.

The game getting patched and changing quite often, I would be surprised if this script still worked after one year.

Leaving this aside:

The library for mouse control used in v2 is quirky on windows in fullscreen I believe, it is preferable to use the libraries used in v1 if you want this to be compatible. You would probably have some work to do around here: https://github.com/DorskFR/LeaguePyBot/tree/main/LPBv2/LPBv2/controller

I was using the version that was up-to-date one year ago for macos, so probably catalina?

For the object detection, I am not sure but it could depend what your screen size is. It is hard coded as 1920x1080 (

).

For the end of game screens, there can be many of them, I did not cover all of them so many will block. Depending on what they are (pick a champ reward, accept level, capsule reward, events, etc.) they are skipped in different ways: through the API (and it requires taking the time to find which call does what: I was logging all calls and trying to find which one works) or by pressing spacebar if it will accept this input (usually when the screen is just an info, not a reward).

The issue here is not really the focus, it is that the client is not in the state allowing to recreate a game until the notifications are skipped.

if event.data in ["WaitingForStats", "PreEndOfGame"]:

commented

Okay. Thank you for your time. I think it is a very nice project and I'll try to make some of the changes you suggeseted.

Thanks again!