added equip ok button check
This commit is contained in:
@@ -8,7 +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
|
from utils import dig_point
|
||||||
|
|
||||||
EMITTER_MAIN = "main"
|
EMITTER_MAIN = "main"
|
||||||
EMITTER_MUSH = "mushroom"
|
EMITTER_MUSH = "mushroom"
|
||||||
@@ -47,11 +47,6 @@ def run():
|
|||||||
tresholds = []
|
tresholds = []
|
||||||
masks = []
|
masks = []
|
||||||
|
|
||||||
fixed_merge_pos_1 = []
|
|
||||||
fixed_merge_pos_2 = []
|
|
||||||
fixed_merge_pos_3 = []
|
|
||||||
fixed_merge_pos_4 = []
|
|
||||||
|
|
||||||
if EMITTER_TO_USE == EMITTER_MUSH:
|
if EMITTER_TO_USE == EMITTER_MUSH:
|
||||||
include_books(needles, hsvs, tresholds, masks)
|
include_books(needles, hsvs, tresholds, masks)
|
||||||
include_mushs(needles, hsvs, tresholds, masks)
|
include_mushs(needles, hsvs, tresholds, masks)
|
||||||
@@ -134,7 +129,12 @@ 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():
|
screenshot = capture_window.get_screenshot_by_area(config.returnOKWindowPos())
|
||||||
|
rectangles = vision_stun.find(screenshot, cv.imread("dig/ok_button.jpg", cv.IMREAD_UNCHANGED), 0.5, 1)
|
||||||
|
if len(rectangles) == 1:
|
||||||
|
pointis = vision_stun.get_click_points(rectangles)
|
||||||
|
for pointi in pointis:
|
||||||
|
dig_point(pointi[0] + config.returnOKWindowPos()[2], pointi[1] + config.returnOKWindowPos()[3], 150)
|
||||||
cv.waitKey(60000)
|
cv.waitKey(60000)
|
||||||
continue
|
continue
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
2
utils.py
2
utils.py
@@ -172,6 +172,4 @@ 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