def Recapture(): global WaitingForClick, Amulet WaitingForClick = True Amulet = NameAmulet.get() AutoSSAWindow = pygetwindow.getWindowsWithTitle( "Module: Auto SSA")[0] TibiaAuto = pygetwindow.getWindowsWithTitle("TibiaAuto V12")[0] AutoSSAWindowX = self.AutoSSA.PositionOfWindow('X') AutoSSAWindowY = self.AutoSSA.PositionOfWindow('Y') time.sleep(0.1) TibiaAuto.minimize() AutoSSAWindow.minimize() Invisible = GUI('InvisibleWindow', 'InvisibleWindow') Invisible.InvisibleWindow('Recapture') while WaitingForClick: X, Y = GetPosition() if keyboard.is_pressed("c"): sX, sY = GetPosition() time.sleep(0.03) from Core.HookWindow import SaveImage SaveImage(ItemsPath + 'Amulets/' + Amulet + '.png', Region=(sX - 6, sY - 28, sX + 6, sY - 16)) WaitingForClick = False Invisible.destroyWindow() TibiaAuto.maximize() time.sleep(0.04) AutoSSAWindow.maximize() AutoSSAWindow.moveTo(AutoSSAWindowX, AutoSSAWindowY) break Invisible.UpdateWindow(X, Y)
def Recapture(): global WaitingForClick, Ring WaitingForClick = True Ring = NameRing.get() AutoRingWindow = pygetwindow.getWindowsWithTitle( "Module: Auto Ring")[0] TibiaAuto = pygetwindow.getWindowsWithTitle("TibiaAuto V12")[0] RootWindowX = root.winfo_x() RootWindowY = root.winfo_y() AutoRingWindowX = self.AutoRing.PositionOfWindow('X') AutoRingWindowY = self.AutoRing.PositionOfWindow('Y') time.sleep(0.1) TibiaAuto.minimize() AutoRingWindow.minimize() Invisible = GUI('InvisibleWindow', 'InvisibleWindow') Invisible.InvisibleWindow('Recapture') while WaitingForClick: X, Y = GetPosition() if keyboard.is_pressed("c"): sX, sY = GetPosition() time.sleep(0.03) pyautogui.screenshot('images/Rings/' + Ring + '.png', region=(sX - 5, sY - 5, 12, 12)) WaitingForClick = False Invisible.destroyWindow() TibiaAuto.maximize() TibiaAuto.moveTo(RootWindowX, RootWindowY) time.sleep(0.04) AutoRingWindow.maximize() AutoRingWindow.moveTo(AutoRingWindowX, AutoRingWindowY) break Invisible.UpdateWindow(X, Y)