refactor dig

This commit is contained in:
2022-05-04 01:51:45 +02:00
parent dddfa60c77
commit ecb3f5df9e
10 changed files with 99 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ import keyboard
from utils import dig_point, check_for_ok_button
from window_capture import WindowCapture
from vision import Vision
from dig_overlay import DiggingOverlay
def run():
# initialize the user-class
@@ -12,7 +13,7 @@ def run():
capture_window = WindowCapture(None, "screen_conf", capture_config)
# initialize the StunVision class
vision_stun = Vision()
dig_overlay = DiggingOverlay(config)
pause = True
@@ -32,15 +33,18 @@ def run():
print('o pressed')
if pause:
# cv.waitKey(500)
dig_overlay.show_window()
print("pausing")
continue
dig_overlay.hide_window()
if level == 3:
width = 30
if level == 17:
DIG_TIME = 1850
DIG_TIME = 150
plot_size = plot_size - level
if level % 3 == 0:
plot_size = plot_size - level
@@ -100,9 +104,9 @@ def run():
for r in range(0, e, 1):
# down click
tp2 = tp2 + plot_size
if tp2 >= config.returnDiggingWindowPos2()[1] + plot_size:
if tp2 >= config.returnDiggingWindowPos2()[1] + (plot_size / 2):
continue
if tp2 <= config.returnDiggingWindowPos2()[3] + plot_size:
if tp2 <= config.returnDiggingWindowPos2()[3] + (plot_size / 2):
continue
dig_point(tp1, tp2, DIG_TIME)
#cv.circle(screenshot, (tp1, tp2), 7, (255, 0, 127), -1)