|
|
@@ -98,8 +98,7 @@ def save_screenshot():
|
|
|
|
|
|
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
|
image = Image.open(io.BytesIO(result))
|
|
|
- # TODO: write screenshots to network folder /mnt/t/nextcloud/InstantUpload/Herowars/
|
|
|
- jpeg_filename = f"fights/{timestamp}.jpg"
|
|
|
+ jpeg_filename = f"/mnt/t/nextcloud/InstantUpload/Herowars/{timestamp}.jpg"
|
|
|
|
|
|
image = image.convert('RGB') # Convert to RGB mode for JPEG
|
|
|
with open(jpeg_filename, "wb") as fp:
|
|
|
@@ -132,7 +131,6 @@ def is_end_of_log(template):
|
|
|
templates = find_templates(template)
|
|
|
result = len(templates) > 0
|
|
|
if result:
|
|
|
- print(templates)
|
|
|
print("reached end of guild war log!")
|
|
|
|
|
|
return result
|
|
|
@@ -207,8 +205,8 @@ def process_war_log():
|
|
|
swipe(find_max_y_pair(buttons), fight_scroll_top)
|
|
|
|
|
|
# start
|
|
|
-while True:
|
|
|
+while not is_end_of_log(end_of_log):
|
|
|
process_war_log();
|
|
|
|
|
|
- if is_end_of_log(end_of_log):
|
|
|
- break;
|
|
|
+# possible duplicates here, but necessary to be sure to get the last fights
|
|
|
+process_war_log();
|