jfd02 / TFT-OCR-BOT

A bot that plays Teamfight Tactics using OCR. Keeps track of bench, board, items, and plays the user defined team comp.
GNU General Public License v3.0
323 stars 91 forks source link

Will the bot support tencent server? #54

Closed HySand closed 2 years ago

HySand commented 2 years ago

I try to run the bot with the guide https://hextechdocs.dev/getting-started-with-the-lcu-api/#the-process-list-method The bot can change arena skin, create lobby and accept the game. But it keep queuing after join the game.

TFT OCR | https://github.com/jfd02/TFT-OCR-BOT
If text is not visible on the top left of the screen, the program is not functioning correctly.
Close this window to terminate the overlay window & program
Did not find window, trying again...
Did not find window, trying again...
Did not find window, trying again...
Did not find window, trying again...
Window League of Legends (TM) Client found
  Location: (0, 0)
  Size:     (1536, 864)

1920*1080 borderless English

jfd02 commented 2 years ago

In game.py, go to the function callback(self, hwnd, extra) and try changing the string "League of Legends (TM) Client" to what ever the window name is for league in your region. If you aren't sure what the window name is, before the if statement add a print statement for window names print(win32gui.GetWindowText(hwnd))

HySand commented 2 years ago

It works after changing the windows scale to 100%(default). But there are some bugs. image

1.It sometimes try to put pieces on when fighting or full team size, then a text will stuck there. 2.? and wrong name. For 1 and 2: i.Beause of Unknown champion from the first carousel? ii.Champion upgrade? 2.Not place items even the item slots are full. 3.Sometimes skip a whole ability selection stage, why not pick a random one if not setted. By the way, may you utlize this way wmic PROCESS WHERE name='LeagueClientUx.exe' GET commandline to get auth-token and app-port? It will be more compatible so i don't need to edit the lockfile manually everytime.

jfd02 commented 2 years ago
  1. Bot doesn't know when fighting begins, it assumes it will be able to finish all tasks before start of round, I could create another thread and watch the timer but not interested in doing this now.

  2. Need to setup the items you want it to make in comps.py, I will make another team comp with some items soon

  3. What do you mean by ability selection stage? If you are referring to augments there is already logic to select a default if one is not in the list. It always picks the left one, if this isn't working you might not have the latest version

  4. Yes I could use wmic PROCESS WHERE name='LeagueClientUx.exe' GET commandline and I have in the past but users with other Windows languages had trouble so I just used the lockfile method