Пример #1
0
 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)
Пример #2
0
 def ReturnGetPosition():
     global WaitingForClick
     WaitingForClick = True
     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('GetPosition')
     while WaitingForClick:
         X, Y = GetPosition()
         if keyboard.is_pressed("c"):
             X, Y = GetPosition()
             WaitingForClick = False
             print(f"Your Click Is Located In: [X: {X}, Y: {Y}]")
             TextEntryX.set(X)
             TextEntryY.set(Y)
             Invisible.destroyWindow()
             TibiaAuto.maximize()
             time.sleep(0.08)
             AutoSSAWindow.maximize()
             AutoSSAWindow.moveTo(AutoSSAWindowX, AutoSSAWindowY)
             break
         Invisible.UpdateWindow(X, Y)
Пример #3
0
 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)