From 862ce4c837b67248dd584e5cad6d34116d7962ad Mon Sep 17 00:00:00 2001 From: Thaloria Date: Sun, 16 Oct 2022 17:17:58 +0200 Subject: [PATCH] added mining ui mode --- combined_bot_main.py | 2 +- combined_user_interface.py | 5 +++-- Mine.py => mine.py | 6 ++---- mine_overlay.py | 1 + 4 files changed, 7 insertions(+), 7 deletions(-) rename Mine.py => mine.py (97%) diff --git a/combined_bot_main.py b/combined_bot_main.py index 2ff764c..a54b721 100644 --- a/combined_bot_main.py +++ b/combined_bot_main.py @@ -6,7 +6,7 @@ from crops import Crops from farm import Farm from magic import Magic from craft import Craft -from Mine import Mine +from mine import Mine def run(): diff --git a/combined_user_interface.py b/combined_user_interface.py index 3dd99b3..8cd23ba 100644 --- a/combined_user_interface.py +++ b/combined_user_interface.py @@ -44,11 +44,11 @@ class PrimaryOverlay(threading.Thread): self.PauseButton = tk.Button self.QuitButton = tk.Button self.TkPosition = '133x239+60+600' - + self.setDaemon(True) self.StatusLabel = tk.Label # self.TkPosition = config.returnEnemyPlayerOverlayPos() - + # self.start() def run(self): @@ -128,6 +128,7 @@ class PrimaryOverlay(threading.Thread): self.root.quit() def destroy(self): + self.hide_mining_overlay() self.root.destroy() def start_button_callback(self): diff --git a/Mine.py b/mine.py similarity index 97% rename from Mine.py rename to mine.py index 8559065..659f809 100644 --- a/Mine.py +++ b/mine.py @@ -3,7 +3,6 @@ import cv2 as cv from utils import dig_point, check_for_ok_button from window_capture import WindowCapture from vision import Vision -from mine_overlay import DiggingOverlay class Mine: @@ -16,7 +15,6 @@ class Mine: # initialize the StunVision class self.vision_stun = Vision() - self.dig_overlay = DiggingOverlay(self.config) self.level = 1 @@ -47,12 +45,12 @@ class Mine: while True: if self.overlay.run_mode == 'paused': cv.waitKey(10) - self.dig_overlay.show_window() + self.overlay.show_mining_overlay() continue elif self.overlay.run_mode == 'stopped': break - self.dig_overlay.hide_window() + self.overlay.hide_mining_overlay() if self.level >= 28: break diff --git a/mine_overlay.py b/mine_overlay.py index 051617d..a1ec91d 100644 --- a/mine_overlay.py +++ b/mine_overlay.py @@ -10,6 +10,7 @@ class DiggingOverlay(threading.Thread): self.root = tk.Tk self.EnemyLabel = tk.Label self.TkPosition = '1440x1150+570+22' + self.setDaemon(True) self.start() def callback(self):