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
324 stars 91 forks source link

KeyError: ‘Board Size’ #269

Closed Victorvhn closed 11 months ago

Victorvhn commented 11 months ago

Hi guys 👋

I'm facing an issue while I try to execute the bot:

C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main>main.py
TFT OCR | https://github.com/jfd02/TFT-OCR-BOT
Close this window to terminate the overlay window & program

[Auto Queue]
  Client found
  Creating lobby
  Changed arena skin to default
  Creating lobby
  Starting queue
  Starting queue

[!] Searching for game window
  Did not find window, trying again...
  Did not find window, trying again...
  Window League of Legends (TM) Client found
    Location: (320, 180)
    Size:     (1920, 1080)

[Carousel Round] 1-1
  Health: 100
  Getting a champ from the carousel

[Second Round] 1-2
  Moving ? to board
  Health: 100

[PvE Round] 1-3
  Shop: [(0, 'Annie'), (1, 'Evelynn'), (2, 'Lillia'), (3, 'Taric'), (4, 'Corki')]
    Purchased Lillia
Process Process-1:
Traceback (most recent call last):
  File "C:\Users\victorvhn\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\victorvhn\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\main.py", line 16, in game_loop
    Game(ui_queue)
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\game.py", line 35, in __init__
    self.loading_screen()
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\game.py", line 65, in loading_screen
    self.game_loop()
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\game.py", line 105, in game_loop
    self.pve_round()
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\game.py", line 158, in pve_round
    self.arena.spend_gold()
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\arena.py", line 367, in spend_gold
    self.buy_champion(champion, 1)
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\arena.py", line 409, in buy_champion
    self.bought_champion(champion[1], none_slot)
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\arena.py", line 79, in bought_champion
    size=game_assets.CHAMPIONS[name]["Board Size"],
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'Board Size'
Traceback (most recent call last):
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\main.py", line 29, in <module>
    overlay.ui_loop()
  File "C:\Users\victorvhn\Desktop\TFT-OCR-BOT-main\ui.py", line 75, in ui_loop
    self.root.mainloop()
  File "C:\Users\victorvhn\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 1485, in mainloop
    self.tk.mainloop(n)
  File "C:\Users\victorvhn\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 1943, in __call__
    def __call__(self, *args):

KeyboardInterrupt

After this error, the bot doesn't work, it doesn't buy or sell anything, it doesn't move, it doesn't leave the game after death, etc...

I didn't make any changes to the comp.py and setting.py files. I'm using Python 3.11.4, tesseract-ocr-w64-setup-5.3.3.20231005, and tesserocr-2.6.0-cp311-cp311-win_amd64.whl.

Do any of you know what it could be?

Edit: I saw this print in another issue: image I don't know if I did something wrong, but in my game, this text overlay is not being displayed.

anthony5301 commented 11 months ago

Please download the lastest game_assets.py. The text overlay in top left corner has been moved to bot's window (the cmd).

Victorvhn commented 11 months ago

Ah, that's all, it's working properly now. I thought I was using the latest version.

Thanks!