From 4f2d99f755193d59248703af4c631265c88ff5e2 Mon Sep 17 00:00:00 2001 From: Thaloria Date: Sat, 21 May 2022 10:49:08 +0200 Subject: [PATCH] added equip ok button check --- equipment_main.py | 9 ++++----- utils.py | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/equipment_main.py b/equipment_main.py index 8abd79e..7f575ec 100644 --- a/equipment_main.py +++ b/equipment_main.py @@ -8,6 +8,7 @@ from hsvfilter import HsvFilter from config_file import UserConfigs import pydirectinput import keyboard +from utils import check_for_ok_button EMITTER_MAIN = "main" EMITTER_MUSH = "mushroom" @@ -126,11 +127,6 @@ def run(): for point in points: click_point(config, points[0][0], points[0][1]) - fixed_merge_pos_1 = [point[0] + 70, point[1]] - fixed_merge_pos_2 = [point[0] + 140, point[1]] - fixed_merge_pos_3 = [point[0] + 70, point[1] + 70] - fixed_merge_pos_4 = [point[0] + 140, point[1] + 70] - if keyboard.is_pressed('p') == True or pause == True: pause = True break @@ -138,6 +134,9 @@ def run(): cv.waitKey(500) for rer in range(0, len(needles), 1): + if check_for_ok_button(): + cv.waitKey(60000) + continue while True: # do object detection screenshot = capture_window.get_screenshot() diff --git a/utils.py b/utils.py index e383ed0..54bd190 100644 --- a/utils.py +++ b/utils.py @@ -172,3 +172,6 @@ def check_for_ok_button(cap_win, vis, conf): pointis = vis.get_click_points(rectangles) for pointi in pointis: dig_point(pointi[0] + offset_left, pointi[1] + offset_down, 150) + return True + return False +