Kyrluckechuck / TFT-Bot

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

"can't open/read file: check file path/integrity" #129

Closed Vermax104 closed 1 year ago

Vermax104 commented 1 year ago

O bot está funcionando no lobby, mas in game ele não funciona, acredito que seja por causa da minha resolução (1440x900), alguma solução para isso? log.txt

Vermax104 commented 1 year ago

I double-checked and found that the path specified in the logs is incorrect/badly formatted. the word "├ürea" is incorrect, the correct one is "Área'', how can I change it?

Kyrluckechuck commented 1 year ago

Interesting, it looks like the encoding for the file path is struggling with the accented Unicode characters -- as a workaround, you could move it to any directory path which does not contain any special characters.

Also what may be worth noting, is you are launching the bot in what appears to be a cloud-synced folder that may cause some weird behaviour, so just wanted to raise that before you have some weird issues! 😛

Kyrluckechuck commented 1 year ago

After further debugging, this Python doc appears highly relevant (for a development fix)

Kyrluckechuck commented 1 year ago

Further debugging, looks like the actual project is fine and it's an issue with the opencv2 library that python-imagesearch uses

One potential workaround is to change to the folder that contains the project/temp files in the context of the program, and then execute. I haven't tested this, but not sure how ideal it is 😬

import os
os.chdir(folder_address_which_contain_your_file)

(via https://github.com/opencv/opencv/issues/21770)

Kyrluckechuck commented 1 year ago

@Vermax104 could you try that same folder but using the branch potential-resource-path-fix?

Kyrluckechuck commented 1 year ago

Since we didn't get a response and the code seemed harmless enough (and it worked in my testing), I've gone ahead and merged it into main, and it will be included in the next release. Please reopen this ticket if it has not been resolved.