Detergent13 / tft-bot

Automate Teamfight Tactics (TFT) for token/mission farming. Updated for Set 11!
GNU Affero General Public License v3.0
81 stars 45 forks source link

bot doesn't use mouse clicks #53

Closed onsraxo closed 2 years ago

onsraxo commented 2 years ago

greetings!

whenever i try to open the tft.py and click the "OK" button , my cursor moves to the "find match" button but doesn't left-click it. i tried queueing and accepting automatically, but ingame it also only hovers the images of units and doesn't actually buy them.

Detergent13 commented 2 years ago

Hi, are you running in administrator mode?

onsraxo commented 2 years ago

there's no option for me to run the tft.py as administrator. when i run the cmd as admin and run the py "tft.py" command, it gives me this output:

C:\WINDOWS\system32>py "D:\league\tokens\tft.py" Developed by:


| \ | | | | | | | | _| | _ _ | | | | | |/ \ / _ \ '/ ` |/ \ ' | | | || | / || / | | (| | / | | | | |____/ _|_\|| _, |_|| ||__| _/ | |/

Welcome! You're running Detergent's TFT bot. Please feel free to ask questions or contribute at https://github.com/Detergent13/tft-bot Bot started, queuing up! Traceback (most recent call last): File "D:\league\tokens\tft.py", line 205, in queue() File "D:\league\tokens\tft.py", line 63, in queue if onscreen("./captures/tft logo.png"): File "D:\league\tokens\tft.py", line 22, in onscreen return search(path, precision)[0] != -1 File "C:\Users\Justin\AppData\Local\Programs\Python\Python38\lib\site-packages\python_imagesearch\imagesearch.py", line 122, in imagesearch template.shape[::-1] AttributeError: 'NoneType' object has no attribute 'shape'

Detergent13 commented 2 years ago

Delete and reinstall opencv and imagesearch, this error is caused by having the wrong version of one of them.

onsraxo commented 2 years ago

done, still gives me the same output.

onsraxo commented 2 years ago

this is my current package list; you can check the versions of imagesearch and opencv, if that helps:

Package Version


MouseInfo 0.1.3 numpy 1.21.2 opencv-python 4.5.1.48 Pillow 8.3.2 pip 21.2.4 printy 2.0.1 PyAutoGUI 0.9.50 PyGetWindow 0.0.9 PyMsgBox 1.0.9 pyperclip 1.8.2 PyRect 0.1.4 PyScreeze 0.1.28 python-imageseach-drov0 1.0.6 python3-xlib 0.15 pytweening 1.0.4 setuptools 41.2.0

fittwitt commented 2 years ago

i managed to fix this error on my side by specifying the working directory as the one with the tft.py in it. To do that you type: cd pathToFolderWithTFT.pyInIt in the command line.

onsraxo commented 2 years ago

this worked for me, thanks a lot.