diff --git a/combine_main_ui.py b/combine_main_ui.py index 07b6209..ebea974 100644 --- a/combine_main_ui.py +++ b/combine_main_ui.py @@ -37,6 +37,8 @@ def run(): else: break + SPAWN_COUNT = int(overlay.spawn_use.get()) + capture_window = WindowCapture(None, "magic", config) # initialize the StunVision class @@ -86,11 +88,11 @@ def run(): #cv.waitKey(150) #continue - spawn_1 = vision_stun.find(screenshot, cv.imread("magic/spawn_1.jpg", cv.IMREAD_UNCHANGED), 0.25, 1) + spawn_1 = vision_stun.find(screenshot, cv.imread("magic/spawn_1.jpg", cv.IMREAD_UNCHANGED), 0.4, 1) if len(spawn_1) == 1: spawn_button_active = True points = vision_stun.get_click_points(spawn_1) - for i in range(0, 100, 1): + for i in range(0, SPAWN_COUNT, 1): pydirectinput.moveTo(points[0][0], points[0][1]) pydirectinput.mouseDown() w = random.randint(1, 50) diff --git a/combine_overlay.py b/combine_overlay.py index 16a17b6..477e004 100644 --- a/combine_overlay.py +++ b/combine_overlay.py @@ -13,11 +13,15 @@ class CombineOverlay(threading.Thread): self.root = tk.Tk + self.spawn_use = tk.StringVar + self.SpawnLabel = tk.Label + self.SpawnEntry = tk.Entry + self.ButtonFrame = tk.Frame self.StartButton = tk.Button self.StopButton = tk.Button - self.TkPosition = '133x52+60+600' + self.TkPosition = '133x75+60+600' self.StatusLabel = tk.Label @@ -25,12 +29,19 @@ class CombineOverlay(threading.Thread): def run(self): self.root = tk.Tk() + self.spawn_use = tk.StringVar(self.root, value='100') + self.SpawnLabel = tk.Label(self.root, text="Spawn:", font=("Helvetica", 10, "bold"), + background="grey") + self.SpawnLabel.grid(row=0, column=0) + self.SpawnEntry = tk.Entry(self.root, textvariable=self.spawn_use, font=("Helvetica", 10, "bold"), width='12') + + self.SpawnEntry.grid(row=0, column=1, columnspan=2) self.ButtonFrame = tk.Frame(self.root) self.StartButton = tk.Button(self.ButtonFrame, text="Start", command=self.start_button_callback, width='8') - self.StartButton.grid(row=0, column=0) + self.StartButton.grid(row=1, column=0) self.StopButton = tk.Button(self.ButtonFrame, text="Stop", command=self.stop_button_callback, width='8', state=tk.DISABLED) - self.StopButton.grid(row=0, column=1) + self.StopButton.grid(row=1, column=1) self.ButtonFrame.grid(row=3, column=0, columnspan=2) diff --git a/magic/perceiving_0.jpg b/magic/perceiving_0.jpg index a8ce413..fe5a272 100644 Binary files a/magic/perceiving_0.jpg and b/magic/perceiving_0.jpg differ