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

Bot working super slow #210

Closed dejdara111 closed 1 year ago

dejdara111 commented 1 year ago

Since the last game patch the bot is working very slow - like it was thinking 4-5 secs before each move. That very often leads to a situation where the round is over and the bot is still trying to move. Because of that the bot is trying to place champions on board when it's not possible and then sells these champions next round thinking that they are on board.

I tried downloading and reinstalling the bot completely but that did not help.

PS. What legend would you prefer for botting? I've been using Poro King but bot never picks up bonus items since they are not in it's walk path.

dejdara111 commented 1 year ago

Today I noticed that on 1-2 (2nd minion round) the bot sold my starting champion, waited around 10 seconds and bought 2 more champions but was too late to place them on the board. I instantly lost to the minions and then bot sold these 2 champions since they were on bench and not on the board. Then bought 1 more, placed it on the board but I lost to 1-3 minions since it was only 1 champion fighting.

anthony5301 commented 1 year ago

what is your computer's spec?

dejdara111 commented 1 year ago

Windows 10 16GB RAM Intel core i7-11700K 3,60 GHz Nvidia GTX 960 Strix 4GB

Worked perfectly fine on previous TFT season.

anthony5301 commented 1 year ago

open cmd then type "cd C:\Program Files\Tesseract-OCR" enter then "tesseract.exe --version" try to update it if version number not v5.3.1.20230401 maybe the ocr progress takes too long

dejdara111 commented 1 year ago

Sadly the issue is still there after updating Tesseract-OCR. It was v5.3.0.something before updating so I guess it wasn't it :/

anthony5301 commented 1 year ago

try this to reinstall all packages pip install -r requirements.txt --ignore-installed if this still doesnt help, try reinstalling the entire Python

dejdara111 commented 1 year ago

Still the same :( above didn't help and neither did reinstalling the entire Python

anthony5301 commented 1 year ago

em...... 1.uninstall python 3.10 2.edit requirements.txt to

numpy==1.25.2 opencv_python==4.8.0.74 Pillow==10.0.0 PyDirectInput==1.0.4 pytesseract==0.3.10 requests==2.31.0 screeninfo==0.8.1 urllib3==2.0.4 pypiwin32==223

3.install python 3.11.4 from https://www.python.org/ftp/python/3.11.4/python-3.11.4-amd64.exe 4.install everything again by pip install -r requirements,txt in cmd

dejdara111 commented 1 year ago

That did not help either. Today I noticed something weird while testing your solution. This happens on PvE round 1-3 (2nd minions round). "Item could not be read for Tacticians Check" I think that could cause this weird 5-8 secs lag before buying a unit and placing it on the board:

image

The "Moving Tristana to board" and "Moving Chogath to board" happened after the round ended resulting in no units on board and insta lose to minions therefore Health 100 -> 94. After that bot thought he had placed Tristana and Chogath on board and sold them the next round.

anthony5301 commented 1 year ago

a quick fix is delete or comment out line128 in game.py self.arena.tacticians_crown_check()

have you ever edit any bot files? like game_assets.py and comps.py

dejdara111 commented 1 year ago

It worked, thank you!

Out of bot files I've only ever edit comps.py but that was in the previous TFT season and it worked perfectly fine. Right now all the files expect for settings files are freshly downloaded.

image

BTW is there any specific legend (the "character" you pick before starting the TFT game) that's best for botting?

anthony5301 commented 1 year ago

It's a little bit tricky bug, I can't reproduce it. BTW the pengu is nice, Tiny Titans make you lives longer, Item Grab Bag take more item but you must edit comps.py more thoughtfully.

If you have spare time, please try this arena.txt (rename to arena.py) and add self.arena.tacticians_crown_check() back to game.py this arena.py will show what that error is, then take a screenshot to me thanks. arena.txt

NaniDaFuck commented 1 year ago

here it is python_B7Qp7st92j