This commit is contained in:
2022-05-05 21:32:35 +02:00
parent bcaa608cd3
commit a969b33c7a

View File

@@ -5,6 +5,7 @@ from window_capture import WindowCapture
from vision import Vision from vision import Vision
from dig_overlay import DiggingOverlay from dig_overlay import DiggingOverlay
def run(): def run():
# initialize the user-class # initialize the user-class
config = UserConfigs() config = UserConfigs()
@@ -15,7 +16,6 @@ def run():
vision_stun = Vision() vision_stun = Vision()
dig_overlay = DiggingOverlay(config) dig_overlay = DiggingOverlay(config)
pause = True pause = True
level = 1 level = 1
@@ -45,21 +45,16 @@ def run():
if level % 2 == 0: if level % 2 == 0:
plot_size = plot_size - 1 plot_size = plot_size - 1
p1 = int((config.returnDiggingWindowPos2()[0] / 2) + config.returnDiggingWindowPos2()[2]) p1 = int((config.returnDiggingWindowPos2()[0] / 2) + config.returnDiggingWindowPos2()[2])
p2 = int((config.returnDiggingWindowPos2()[1] / 2) + config.returnDiggingWindowPos2()[3]) p2 = int((config.returnDiggingWindowPos2()[1] / 2) + config.returnDiggingWindowPos2()[3])
# start 705 , 564 -> click # start 705 , 564 -> click
# move L D -> click # move L D -> click
# move U , U , R, R , D , D , L , L # move U , U , R, R , D , D , L , L
# move L D # move L D
# move U , U , U , U , R, R , R, R, D, D, D, D, L, L, L , L # move U , U , U , U , R, R , R, R, D, D, D, D, L, L, L , L
dig_point(p1, p2, DIG_TIME) dig_point(p1, p2, DIG_TIME)
#cv.circle(screenshot, (p1, p2), 7, (0, 255, 0), -1) # cv.circle(screenshot, (p1, p2), 7, (0, 255, 0), -1)
i = 0 i = 0
for e in range(2, width, 2): for e in range(2, width, 2):
i = i + 1 i = i + 1
@@ -75,9 +70,9 @@ def run():
continue continue
dig_point(tp1, tp2, DIG_TIME) dig_point(tp1, tp2, DIG_TIME)
#cv.circle(screenshot, (tp1, tp2), 7, (255, 0, 255), -1) # cv.circle(screenshot, (tp1, tp2), 7, (255, 0, 255), -1)
#cv.imshow("screenshot", screenshot) # cv.imshow("screenshot", screenshot)
#cv.waitKey(150) # cv.waitKey(150)
check_for_ok_button(capture_window, vision_stun, capture_config) check_for_ok_button(capture_window, vision_stun, capture_config)
if keyboard.is_pressed('p') == True or pause == True: if keyboard.is_pressed('p') == True or pause == True:
pause = True pause = True
@@ -91,9 +86,9 @@ def run():
if tp2 <= config.returnDiggingWindowPos2()[3] + plot_size: if tp2 <= config.returnDiggingWindowPos2()[3] + plot_size:
continue continue
dig_point(tp1, tp2, DIG_TIME) dig_point(tp1, tp2, DIG_TIME)
#cv.circle(screenshot, (tp1, tp2), 7, (127, 0, 255), -1) # cv.circle(screenshot, (tp1, tp2), 7, (127, 0, 255), -1)
#cv.imshow("screenshot", screenshot) # cv.imshow("screenshot", screenshot)
#cv.waitKey(150) # cv.waitKey(150)
check_for_ok_button(capture_window, vision_stun, capture_config) check_for_ok_button(capture_window, vision_stun, capture_config)
if keyboard.is_pressed('p') == True or pause == True: if keyboard.is_pressed('p') == True or pause == True:
pause = True pause = True
@@ -109,9 +104,9 @@ def run():
if tp2 <= config.returnDiggingWindowPos2()[3] + (plot_size / 2): if tp2 <= config.returnDiggingWindowPos2()[3] + (plot_size / 2):
continue continue
dig_point(tp1, tp2, DIG_TIME) dig_point(tp1, tp2, DIG_TIME)
#cv.circle(screenshot, (tp1, tp2), 7, (255, 0, 127), -1) # cv.circle(screenshot, (tp1, tp2), 7, (255, 0, 127), -1)
#cv.imshow("screenshot", screenshot) # cv.imshow("screenshot", screenshot)
#cv.waitKey(150) # cv.waitKey(150)
check_for_ok_button(capture_window, vision_stun, capture_config) check_for_ok_button(capture_window, vision_stun, capture_config)
if keyboard.is_pressed('p') == True or pause == True: if keyboard.is_pressed('p') == True or pause == True:
pause = True pause = True
@@ -125,9 +120,9 @@ def run():
if tp2 >= config.returnDiggingWindowPos2()[1] + plot_size: if tp2 >= config.returnDiggingWindowPos2()[1] + plot_size:
continue continue
dig_point(tp1, tp2, DIG_TIME) dig_point(tp1, tp2, DIG_TIME)
#cv.circle(screenshot, (tp1, tp2), 7, (0, 0, 255), -1) # cv.circle(screenshot, (tp1, tp2), 7, (0, 0, 255), -1)
#cv.imshow("screenshot", screenshot) # cv.imshow("screenshot", screenshot)
#cv.waitKey(150) # cv.waitKey(150)
check_for_ok_button(capture_window, vision_stun, capture_config) check_for_ok_button(capture_window, vision_stun, capture_config)
if keyboard.is_pressed('p') == True or pause == True: if keyboard.is_pressed('p') == True or pause == True:
pause = True pause = True
@@ -138,6 +133,8 @@ def run():
if keyboard.is_pressed('p') == True or pause == True: if keyboard.is_pressed('p') == True or pause == True:
pause = True pause = True
break break
level = level +1 level = level + 1
if __name__ == "__main__": if __name__ == "__main__":
run() run()