Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
numpy==1.24.1
numpy==1.26.0
opencv-python==4.7.0.68
6 changes: 5 additions & 1 deletion screenshot.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import os
import platform


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