diff --git a/bot.py b/bot.py index e935f9c..4e1542e 100644 --- a/bot.py +++ b/bot.py @@ -108,7 +108,7 @@ def run(): max_coords = coords # Check if the maximum value is above a certain threshold - if max_val > 0.95: + if max_val > 0.90: logging.info(f"Image {max_image_file} matches with {max_val * 100}%") # If not ingame reset timer diff --git a/requirements.txt b/requirements.txt index d814dfa..13460b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -numpy==1.24.1 +numpy==1.26.0 opencv-python==4.7.0.68 diff --git a/screenshot.py b/screenshot.py index b576311..aec47e2 100644 --- a/screenshot.py +++ b/screenshot.py @@ -1,4 +1,5 @@ import os +import platform def capture_screenshot(filename): @@ -6,6 +7,9 @@ def capture_screenshot(filename): Captures a screenshot of the Android screen using adb and saves it to a file. Returns True if the adb command was successful, False otherwise. """ - adb_command = "adb exec-out screencap -p > {} 2> /dev/null".format(filename) + if platform.system() == "Windows": + adb_command = "adb exec-out screencap -p > {}".format(filename) + else: + adb_command = "adb exec-out screencap -p > {} 2> /dev/null".format(filename) error_code = os.system(adb_command) return error_code == 0