Detergent13 / tft-bot

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

having problems starting the program #123

Closed josephisticated closed 5 months ago

josephisticated commented 1 year ago

getting this output with python 3.8.3:

Bot started, queuing up! Traceback (most recent call last): File "tft.py", line 225, in queue() File "tft.py", line 63, in queue if onscreen("./captures/tft logo.png"): File "tft.py", line 26, in onscreen return search(path, precision)[0] != -1 File "C:\Users\Yusuf\AppData\Local\Programs\Python\Python38\lib\site-packages\python_imagesearch\imagesearch.py", line 115, in imagesearch im = pyautogui.screenshot() File "C:\Users\Yusuf\AppData\Local\Programs\Python\Python38\lib\site-packages\pyautogui__init__.py", line 224, in _couldNotImportPyScreeze raise PyAutoGUIException( pyautogui.PyAutoGUIException: PyAutoGUI was unable to import pyscreeze. (This is likely because you're running a version of Python that Pillow (which pyscreeze depends on) doesn't support currently.) Please install this module to enable the function you tried to call.

downloaded dependencies too

Detergent13 commented 1 year ago

What's the output of python -V? (or py -V)

I see you mentioned you installed 3.8.3, but just making sure the correct version is actually running.

josephisticated commented 1 year ago

output is Python 3.8.3

Detergent13 commented 1 year ago

In that case, probably worth deleting your python modules folder and re-installing the requirements.

josephisticated commented 1 year ago

cleared the modules' folder and reinstalled default ones, ran pip install -r requirements.txt and then tried again but having the same error again.

Detergent13 commented 1 year ago

My guess would be that you somehow have two different modules directories somehow? Maybe try creating a venv in anaconda if it's convenient for you?

I'm not completely sure though, those two steps should've knocked out most common issues.

If anybody else has experience with a similar issue, please feel free to chime in!

Gogoreds commented 1 year ago

Hey Detergent, I'm getting the same error here; "PyAutoGUI was unable to import pyscreeze. (This is likely because you're running a version of Python that Pillow (which pyscreeze depends on) doesn't support currently.) Please install this module to enable the function you tried to call." Tried your suggestions to joseph and still the same, any solutions to this?

RomeoAlphaEkko commented 1 year ago

Tried your suggestions to joseph and still the same, any solutions to this?

Hi, is it sometimes happening, always?

did u just start using it or have been for a longer time?

Gogoreds commented 1 year ago

Hey,

Thanks for replying on a Sunday! I actually just installed it today and ran into the pyscreeze error. But yeah it just never started for me.

Please keep in mind that I'm not a Python developer, a newbie web dev here.

RomeoAlphaEkko commented 1 year ago

TO BE IGNORED

pyscreeze

if you have a bit of time, we could try some trouble shooting

try switching out def end_match()

def end_match():
    while not onscreen("./captures/find match ready.png"):  # added a main loop for the end match function to ensure you make it to the find match button.
        while onscreen("./captures/missions ok.png"):
            click_to("./captures/missions ok.png")
            time.sleep(2)
        while onscreen("./captures/skip waiting for stats.png"):
            click_to("./captures/skip waiting for stats.png")
            time.sleep(5)
        while onscreen("./captures/play again.png"):
            click_to("./captures/play again.png")
        play()

best to do a copy of the tft.py and change it there then testrun it

we took out the screenshot function

Gogoreds commented 1 year ago

Yes sir, just booting it up now.

RomeoAlphaEkko commented 1 year ago

another test you could do is go to your "cmd" type "pip list" scroll down and check what version your pyscreeze is

Gogoreds commented 1 year ago

play() is not defined.

RomeoAlphaEkko commented 1 year ago

ups, my bad, we never implemented the screenshot function here.

just delete that try and check ur pyscreeze verison

Gogoreds commented 1 year ago

image

Everything seems to be in order declared in requirements.txt

RomeoAlphaEkko commented 1 year ago

@Detergent13 you are better at this

some info drop from me Pillow 9.0.0 pip 23.0.1 (could be updated) PyAutoGUI 0.9.50 PyScreeze 0.1.28

https://pillow.readthedocs.io/en/stable/installation.html

Gogoreds commented 1 year ago

Is the script running with the these updated versions of packages? Should I just go ahead and change the requirements to these and try again?

Detergent13 commented 1 year ago

Sorry, I completely forgot to respond to this. That's certainly worth a try! I would also recommend giving a virtual environment such as anaconda a shot- make a new environment with Python 3.8.3, install the requirements, and attempt to run under the environment.

sotha-sil-zen commented 1 year ago

https://github.com/Detergent13/tft-bot/issues/126#issuecomment-1657131450

This may help.

Detergent13 commented 5 months ago

Should be fixed in #138