added equip ok button check
This commit is contained in:
@@ -8,6 +8,7 @@ from hsvfilter import HsvFilter
|
|||||||
from config_file import UserConfigs
|
from config_file import UserConfigs
|
||||||
import pydirectinput
|
import pydirectinput
|
||||||
import keyboard
|
import keyboard
|
||||||
|
from utils import check_for_ok_button
|
||||||
|
|
||||||
EMITTER_MAIN = "main"
|
EMITTER_MAIN = "main"
|
||||||
EMITTER_MUSH = "mushroom"
|
EMITTER_MUSH = "mushroom"
|
||||||
@@ -126,11 +127,6 @@ def run():
|
|||||||
for point in points:
|
for point in points:
|
||||||
click_point(config, points[0][0], points[0][1])
|
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:
|
if keyboard.is_pressed('p') == True or pause == True:
|
||||||
pause = True
|
pause = True
|
||||||
break
|
break
|
||||||
@@ -138,6 +134,9 @@ def run():
|
|||||||
|
|
||||||
cv.waitKey(500)
|
cv.waitKey(500)
|
||||||
for rer in range(0, len(needles), 1):
|
for rer in range(0, len(needles), 1):
|
||||||
|
if check_for_ok_button():
|
||||||
|
cv.waitKey(60000)
|
||||||
|
continue
|
||||||
while True:
|
while True:
|
||||||
# do object detection
|
# do object detection
|
||||||
screenshot = capture_window.get_screenshot()
|
screenshot = capture_window.get_screenshot()
|
||||||
|
|||||||
3
utils.py
3
utils.py
@@ -172,3 +172,6 @@ def check_for_ok_button(cap_win, vis, conf):
|
|||||||
pointis = vis.get_click_points(rectangles)
|
pointis = vis.get_click_points(rectangles)
|
||||||
for pointi in pointis:
|
for pointi in pointis:
|
||||||
dig_point(pointi[0] + offset_left, pointi[1] + offset_down, 150)
|
dig_point(pointi[0] + offset_left, pointi[1] + offset_down, 150)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user