class FoodEater: def __init__(self, root): self.FoodEater = GUI('FoodEater', 'Module: Food Eater') self.FoodEater.DefaultWindow('DefaultWindow') def SetFoodEater(): global EnabledFoodEater if not EnabledFoodEater: EnabledFoodEater = True ButtonEnabled.configure(text='FoodEater: ON') ScanFoodEater() else: EnabledFoodEater = False ButtonEnabled.configure(text='FoodEater: OFF') def ScanFoodEater(): if EnabledFoodEater: print("Try Lock FoodEater") print("Try This") root.after(300, ScanFoodEater) CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() self.FoodEater.addButton('Ok', self.FoodEater.destroyWindow, [84, 29, 130, 504], [127, 17, 8], [123, 13, 5]) global EnabledFoodEater if not EnabledFoodEater: ButtonEnabled = self.FoodEater.addButton('FoodEater: OFF', SetFoodEater, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) else: ButtonEnabled = self.FoodEater.addButton('FoodEater: ON', SetFoodEater, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) ButtonPrint = self.FoodEater.addCheck(CheckPrint, [10, 408], [120, 98, 51], 0, "Print on Tibia's screen") ButtonLowMana = self.FoodEater.addCheck(LowMana, [10, 440], [120, 98, 51], 0, "Low Mana Warnings") self.FoodEater.loop()
class SaveConfig: def __init__(self, root): self.SaveConfig = GUI('SaveConfig', 'Module: Save Config') self.SaveConfig.DefaultWindow('DefaultWindow') def SetSaveConfig(): global EnabledSaveConfig if not EnabledSaveConfig: EnabledSaveConfig = True ButtonEnabled.configure(text='SaveConfig: ON') ScanSaveConfig() else: EnabledSaveConfig = False ButtonEnabled.configure(text='SaveConfig: OFF') def ScanSaveConfig(): if EnabledSaveConfig: print("Try Lock SaveConfig") print("Try This") root.after(300, ScanSaveConfig) CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() self.SaveConfig.addButton('Ok', self.SaveConfig.destroyWindow, [84, 29, 130, 504], [127, 17, 8], [123, 13, 5]) global EnabledSaveConfig if not EnabledSaveConfig: ButtonEnabled = self.SaveConfig.addButton('SaveConfig: OFF', SetSaveConfig, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) else: ButtonEnabled = self.SaveConfig.addButton('SaveConfig: ON', SetSaveConfig, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) ButtonPrint = self.SaveConfig.addCheck(CheckPrint, [10, 408], [120, 98, 51], 0, "Print on Tibia's screen") ButtonLowMana = self.SaveConfig.addCheck(LowMana, [10, 440], [120, 98, 51], 0, "Low Mana Warnings") self.SaveConfig.loop()
class AdjustConfig: def __init__(self, root): self.AdjustConfig = GUI('AdjustConfig', 'Module: Adjust Config') self.AdjustConfig.DefaultWindow('AdjustConfig', [830, 616], [2.25, 2.40]) def ScanAdjustConfig(): print("Try Lock AdjustConfig") print("Try This") self.AdjustConfig.addButton('Ok', self.AdjustConfig.destroyWindow, [810, 25], [10, 580]) self.AdjustConfig.loop()
class Monsters: def __init__(self, root): self.Monsters = GUI('Monsters', 'Module: Monsters') self.Monsters.DefaultWindow('DefaultWindow') def SetMonsters(): global EnabledMonsters if not EnabledMonsters: EnabledMonsters = True ButtonEnabled.configure(text='Monsters: ON') ScanMonsters() else: EnabledMonsters = False ButtonEnabled.configure(text='Monsters: OFF') def ScanMonsters(): if EnabledMonsters: print("Try Lock Monsters") print("Try This") root.after(300, ScanMonsters) CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() self.Monsters.addButton('Ok', self.Monsters.destroyWindow, [84, 29, 130, 504], [127, 17, 8], [123, 13, 5]) global EnabledMonsters if not EnabledMonsters: ButtonEnabled = self.Monsters.addButton('Monsters: OFF', SetMonsters, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) else: ButtonEnabled = self.Monsters.addButton('Monsters: ON', SetMonsters, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) ButtonPrint = self.Monsters.addCheck(CheckPrint, [10, 408], [120, 98, 51], 0, "Print on Tibia's screen") ButtonLowMana = self.Monsters.addCheck(LowMana, [10, 440], [120, 98, 51], 0, "Low Mana Warnings") self.Monsters.loop()
class CreatureInfo: def __init__(self, root): self.CreatureInfo = GUI('CreatureInfo', 'Module: Creature Info') self.CreatureInfo.DefaultWindow('DefaultWindow') def SetCreatureInfo(): global EnabledCreatureInfo if not EnabledCreatureInfo: EnabledCreatureInfo = True ButtonEnabled.configure(text='CreatureInfo: ON') ScanCreatureInfo() else: EnabledCreatureInfo = False ButtonEnabled.configure(text='CreatureInfo: OFF') def ScanCreatureInfo(): if EnabledCreatureInfo: print("Try Lock CreatureInfo") print("Try This") root.after(300, ScanCreatureInfo) CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() self.CreatureInfo.addButton('Ok', self.CreatureInfo.destroyWindow, [84, 29, 130, 504], [127, 17, 8], [123, 13, 5]) global EnabledCreatureInfo if not EnabledCreatureInfo: ButtonEnabled = self.CreatureInfo.addButton( 'CreatureInfo: OFF', SetCreatureInfo, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) else: ButtonEnabled = self.CreatureInfo.addButton( 'CreatureInfo: ON', SetCreatureInfo, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) ButtonPrint = self.CreatureInfo.addCheck(CheckPrint, [10, 408], [120, 98, 51], 0, "Print on Tibia's screen") ButtonLowMana = self.CreatureInfo.addCheck(LowMana, [10, 440], [120, 98, 51], 0, "Low Mana Warnings") self.CreatureInfo.loop()
class HealerFriend: def __init__(self, root): self.HealerFriend = GUI('HealerFriend', 'Module: Healer Friend') self.HealerFriend.DefaultWindow('DefaultWindow') def SetHealerFriend(): global EnabledHealerFriend if not EnabledHealerFriend: EnabledHealerFriend = True ButtonEnabled.configure(text='HealerFriend: ON') ScanHealerFriend() else: EnabledHealerFriend = False ButtonEnabled.configure(text='HealerFriend: OFF') def ScanHealerFriend(): if EnabledHealerFriend: print("Try Lock HealerFriend") print("Try This") root.after(300, ScanHealerFriend) CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() self.HealerFriend.addButton('Ok', self.HealerFriend.destroyWindow, [84, 29, 130, 504], [127, 17, 8], [123, 13, 5]) global EnabledHealerFriend if not EnabledHealerFriend: ButtonEnabled = self.HealerFriend.addButton( 'HealerFriend: OFF', SetHealerFriend, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) else: ButtonEnabled = self.HealerFriend.addButton( 'HealerFriend: ON', SetHealerFriend, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) ButtonPrint = self.HealerFriend.addCheck(CheckPrint, [10, 408], [120, 98, 51], 0, "Print on Tibia's screen") ButtonLowMana = self.HealerFriend.addCheck(LowMana, [10, 440], [120, 98, 51], 0, "Low Mana Warnings") self.HealerFriend.loop()
class AutoLogin: def __init__(self, root): self.AutoLogin = GUI('AutoLogin', 'Module: Auto Login') self.AutoLogin.DefaultWindow('AutoLogin', [339, 540], [1.2, 2.29]) def SetAutoLogin(): global EnabledAutoLogin if not EnabledAutoLogin: EnabledAutoLogin = True print("AutoLogin: ON") ButtonEnabled.configure(text='AutoLogin: ON', relief=SUNKEN, bg=rgb((158, 46, 34))) CheckingButtons() ScanAutoLogin() else: EnabledAutoLogin = False print("AutoLogin: OFF") CheckingButtons() ButtonEnabled.configure(text='AutoLogin: OFF', relief=RAISED, bg=rgb((127, 17, 8))) def ScanAutoLogin(): global EnabledAutoLogin if EnabledAutoLogin: AccountName = GetAccountNamePosition() if AccountName[0] and AccountName[1] != 0: print("You Are Offline... Trying To Login") login = pyautogui.locateOnScreen( 'images/TibiaSettings/Login.png', grayscale=True, confidence=0.8) print("Your Login location is:", login) Login[0], Login[1] = pyautogui.center(login) global username_value username_value = username.get() global passwd_value passwd_value = passwd.get() time.sleep(1) global pass_mouse_position if Login is not None: pass_mouse_position = pyautogui.position() pyautogui.click(x=AccountName[0], y=AccountName[1]) pyautogui.write(username_value, interval=0.15) pyautogui.press('tab') pyautogui.write(passwd_value, interval=0.15) pyautogui.click(Login[0], Login[1]) time.sleep(2) pyautogui.press('enter') pyautogui.moveTo(pass_mouse_position) AccountName2 = pyautogui.locateOnScreen( 'images/TibiaSettings/AccountName.png', grayscale=True, confidence=0.8) if AccountName2 is not None: print("Error To Login !!!!") else: print("You Are Logged") else: print("Error To Locate Login Button!") else: print("You Are Online...") if EnabledAutoLogin: root.after(3000, ScanAutoLogin) CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() TextEntryUsername = tk.StringVar() TextEntryYPasswd = tk.StringVar() self.AutoLogin.addButton('Ok', self.AutoLogin.destroyWindow, [84, 29], [130, 504]) global EnabledAutoLogin if not EnabledAutoLogin: ButtonEnabled = self.AutoLogin.addButton('AutoLogin: OFF', SetAutoLogin, [328, 29], [12, 469]) else: ButtonEnabled = self.AutoLogin.addButton('AutoLogin: ON', SetAutoLogin, [328, 29], [12, 469]) ButtonPrint = self.AutoLogin.addCheck(CheckPrint, [10, 408], [120, 98, 51], 0, "Print on Tibia's screen") ButtonLowMana = self.AutoLogin.addCheck(LowMana, [10, 440], [120, 98, 51], 0, "Low Mana Warnings") username_label = self.AutoLogin.addLabel('Username', [130, 16, 6], [69, 84]) username = self.AutoLogin.addEntry([149, 86], TextEntryUsername, 10) global username_value username_value = username.get() passwd_label = self.AutoLogin.addLabel('Password', [130, 16, 6], [69, 124]) passwd = self.AutoLogin.addEntry([149, 126], TextEntryYPasswd, 10) global passwd_value passwd_value = passwd.get() def CheckingButtons(): if EnabledAutoLogin: username_label.configure(state='disabled') passwd_label.configure(state='disabled') username.configure(state='disabled') passwd.configure(state='disabled') else: username_label.configure(state='normal') passwd_label.configure(state='normal') username.configure(state='normal') passwd.configure(state='normal') CheckingButtons() self.AutoLogin.loop()
class ColorChange: def __init__(self, root, Player): self.ColorChange = GUI('ColorChange', 'Module: Color Change') self.ColorChange.DefaultWindow('AutoHeal', [306, 472], [1.2, 2.29]) def SetColorChange(): global EnabledColorChange if not EnabledColorChange: EnabledColorChange = True ButtonEnabled.configure(text='ColorChange: ON') ScanColorChange() else: EnabledColorChange = False ButtonEnabled.configure(text='ColorChange: OFF') def ScanColorChange(): while EnabledColorChange: if keyboard.is_pressed("c"): pyautogui.PAUSE = 0.04 print("Pressed C") ChangeColor2() pyautogui.PAUSE = 0.005 def Rotate(): pyautogui.keyDown("ctrl") pyautogui.press('right') pyautogui.press('up') pyautogui.press('left') pyautogui.press('down') pyautogui.keyUp('ctrl') def ChangeColor(): pyautogui.click(Player[0], Player[1]) pyautogui.keyDown("ctrl") pyautogui.click(x=Player[0], y=Player[1], button='right') pyautogui.keyUp('ctrl') time.sleep(0.1) SetOutfit = pyautogui.locateOnScreen( 'images/PlayerSettings/SetOutfit.png', confidence=0.9) if SetOutfit: pyautogui.click(x=SetOutfit[0], y=SetOutfit[1], button='left') def ChangeColor2(): MousePosition = pyautogui.position() pyautogui.keyDown('shift') Move1(MousePosition) Move2(MousePosition) Move1(MousePosition) Move2(MousePosition) Move1(MousePosition) Move2(MousePosition) Move1(MousePosition) pyautogui.keyUp('shift') def Move1(MousePosition): pyautogui.moveTo(1220, 440) pyautogui.mouseDown(button='left') pyautogui.moveTo(MousePosition[0], MousePosition[1]) pyautogui.mouseUp(button='left') def Move2(MousePosition): pyautogui.moveTo(1215, 540) pyautogui.mouseDown(button='left') pyautogui.moveTo(MousePosition[0], MousePosition[1]) pyautogui.mouseUp(button='left') CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() self.ColorChange.addButton('Ok', self.ColorChange.destroyWindow, [73, 21], [115, 440]) global EnabledColorChange if not EnabledColorChange: ButtonEnabled = self.ColorChange.addButton('ColorChange: OFF', SetColorChange, [328, 29], [12, 469]) else: ButtonEnabled = self.ColorChange.addButton('ColorChange: ON', SetColorChange, [328, 29], [12, 469]) ButtonPrint = self.ColorChange.addCheck(CheckPrint, [10, 408], [120, 98, 51], 0, "Print on Tibia's screen") ButtonLowMana = self.ColorChange.addCheck(LowMana, [10, 440], [120, 98, 51], 0, "Low Mana Warnings") self.ColorChange.loop()
class AutoAttack: def __init__(self, root, SQMs, BattlePosition): self.AutoAttack = GUI('AutoAttack', 'Module: Auto Attack') self.AutoAttack.DefaultWindow('DefaultWindow') def SetAutoAttack(): global EnabledAutoAttack if not EnabledAutoAttack: EnabledAutoAttack = True ButtonEnabled.configure(text='AutoAttack: ON') combine_funcs(ScanAutoAttack(), ScanFollowMode()) else: EnabledAutoAttack = False ButtonEnabled.configure(text='AutoAttack: OFF') def ScanAutoAttack(): if EnabledAutoAttack: global TargetNumber monster = monster2.get() TargetNumber = AttackTarget(monster, BattlePosition, SQMs, TargetNumber) if EnabledAutoAttack: root.after(300, ScanAutoAttack) def ScanFollowMode(): if EnabledAutoAttack: follow_x_pos, follow_y_pos = SetFollow() if follow_x_pos != 0 and follow_y_pos != 0: past_mouse_position = pyautogui.position() pyautogui.leftClick(follow_x_pos, follow_y_pos) pyautogui.moveTo(past_mouse_position) if EnabledAutoAttack: root.after(3000, ScanFollowMode) CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() AttackOne = tk.BooleanVar() monster2 = tk.StringVar() monster2.set(monster) PriorityOne = tk.IntVar() PriorityOne.set(1) self.AutoAttack.addButton('Ok', self.AutoAttack.destroyWindow, [84, 29, 130, 504], [127, 17, 8], [123, 13, 5]) global EnabledAutoAttack if not EnabledAutoAttack: ButtonEnabled = self.AutoAttack.addButton('AutoAttack: OFF', SetAutoAttack, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) else: ButtonEnabled = self.AutoAttack.addButton('AutoAttack: ON', SetAutoAttack, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) ButtonPrint = self.AutoAttack.addCheck(CheckPrint, [10, 408], [120, 98, 51], 0, "Print on Tibia's screen") ButtonLowMana = self.AutoAttack.addCheck(LowMana, [10, 440], [120, 98, 51], 0, "Low Mana Warnings") CheckAttackOne = self.AutoAttack.addCheck(AttackOne, [32, 74], [130, 16, 6], 1, 'Monster One') OptionMonstersOne = self.AutoAttack.addOption(monster2, monsters, [155, 70]) PriorityMonstersOne = self.AutoAttack.addOption( PriorityOne, priority, [240, 70]) self.AutoAttack.loop()
class AutoBanker: def __init__(self, root): self.AutoBanker = GUI('AutoBanker', 'Module: Auto Banker') self.AutoBanker.DefaultWindow('AltoBanker', [224, 171], [1.2, 2.29]) def SetAutoBanker(): global EnabledAutoBanker if not EnabledAutoBanker: EnabledAutoBanker = True ButtonEnabled.configure(text='AutoBanker: ON') ScanAutoBanker() else: EnabledAutoBanker = False ButtonEnabled.configure(text='AutoBanker: OFF') def ScanAutoBanker(): if EnabledAutoBanker: CapLocate = pyautogui.locateOnScreen( 'images/PlayerStats/Cap.png') if CapLocate: FirstNumberBox = CapLocate[0] + 21, CapLocate[1] + 7 EndFirstNumberBox = FirstNumberBox[0] + 7, FirstNumberBox[ 1] + 10 SecondNumberBox = CapLocate[0] + 15, CapLocate[1] + 7 EndSecondNumberBox = SecondNumberBox[ 0] + 7, SecondNumberBox[1] + 10 ThirdNumberBox = CapLocate[0] + 9, CapLocate[1] + 7 EndThirdNumberBox = ThirdNumberBox[0] + 7, ThirdNumberBox[ 1] + 10 FourNumberBox = CapLocate[0] + 3, CapLocate[1] + 7 EndFourNumberBox = FourNumberBox[0] + 7, FourNumberBox[ 1] + 10 FirstNumber = ScanCap(FirstNumberBox, EndFirstNumberBox) SecondNumber = ScanCap(SecondNumberBox, EndSecondNumberBox) ThirdNumber = ScanCap(ThirdNumberBox, EndThirdNumberBox) FourNumber = ScanCap(FourNumberBox, EndFourNumberBox) print(FourNumber, ThirdNumber, SecondNumber, FirstNumber) time.sleep(1) root.after(300, ScanAutoBanker) CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() self.AutoBanker.addButton('Ok', self.AutoBanker.destroyWindow, [84, 29, 130, 504], [127, 17, 8], [123, 13, 5]) global EnabledAutoBanker if not EnabledAutoBanker: ButtonEnabled = self.AutoBanker.addButton('AutoBanker: OFF', SetAutoBanker, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) else: ButtonEnabled = self.AutoBanker.addButton('AutoBanker: ON', SetAutoBanker, [328, 29, 12, 469], [127, 17, 8], [123, 13, 5]) ButtonPrint = self.AutoBanker.addCheck(CheckPrint, [10, 408], [120, 98, 51], 0, "Print on Tibia's screen") ButtonLowMana = self.AutoBanker.addCheck(LowMana, [10, 440], [120, 98, 51], 0, "Low Mana Warnings") self.AutoBanker.loop()
class AutoHeal: def __init__(self, root, HealthLocation, MOUSE_OPTION, HOOK_OPTION): self.AutoHeal = GUI('AutoHeal', 'Module: Auto Heal') self.AutoHeal.DefaultWindow('AutoHeal2', [306, 372], [1.2, 2.29]) self.SendToClient = Hotkey(MOUSE_OPTION) self.Scan = ScanStages('Life', HOOK_OPTION) def SetAutoHeal(): global EnabledAutoHeal if not EnabledAutoHeal: EnabledAutoHeal = True ButtonEnabled.configure(text='AutoHealing: ON', relief=SUNKEN, bg=rgb((158, 46, 34))) print("AutoHealing: ON") CheckingButtons() try: ThreadCaveBot = threading.Thread(target=scanning_auto_life) ThreadCaveBot.start() except: print("Error: Unable To Start ThreadCaveBot!") else: EnabledAutoHeal = False print("AutoHealing: OFF") CheckingButtons() ButtonEnabled.configure(text='AutoHealing: OFF', relief=RAISED, bg=rgb((114, 0, 0))) def scanning_auto_life(): while EnabledAutoHeal: global life try: life = self.Scan.ScanStages(HealthLocation, lifeColor, lifeColorFull) except Exception: life = 100 pass if life is None: life = 0 if VarCheckStageThree.get(): stage_three = VarPercentageStageThree.get() if stage_three > life or stage_three == life: self.SendToClient.Press(VarHotkeyStageThree.get()) print("Pressed ", VarHotkeyStageThree.get()) time.sleep(.15) elif VarCheckStageTwo.get(): stage_two = VarPercentageStageTwo.get() if stage_two > life or stage_two == life: self.SendToClient.Press(VarHotkeyStageTwo.get()) print("Pressed ", VarHotkeyStageTwo.get()) time.sleep(.15) elif VarCheckStageOne.get(): stage_one = VarPercentageStageOne.get() if stage_one > life or stage_one == life: self.SendToClient.Press(VarHotkeyStageOne.get()) print("Pressed ", VarHotkeyStageOne.get()) time.sleep(.15) elif VarCheckStageOne.get(): stage_one = VarPercentageStageOne.get() if stage_one > life or stage_one == life: self.SendToClient.Press(VarHotkeyStageOne.get()) print("Pressed ", VarHotkeyStageOne.get()) time.sleep(.15) elif VarCheckStageTwo.get(): stage_two = VarPercentageStageTwo.get() if stage_two > life or stage_two == life: self.SendToClient.Press(VarHotkeyStageTwo.get()) print("Pressed ", VarHotkeyStageTwo.get()) time.sleep(.15) elif VarCheckStageThree.get(): stage_three = VarPercentageStageThree.get() if stage_three > life or stage_three == life: self.SendToClient.Press(VarHotkeyStageThree.get()) print("Pressed ", VarHotkeyStageThree.get()) time.sleep(.15) elif VarCheckStageOne.get(): stage_one = VarPercentageStageOne.get() if stage_one > life or stage_one == life: self.SendToClient.Press(VarHotkeyStageOne.get()) print("Pressed ", VarHotkeyStageOne.get()) time.sleep(.15) elif VarCheckStageOne.get(): stage_one = VarPercentageStageOne.get() if stage_one > life or stage_one == life: self.SendToClient.Press(VarHotkeyStageOne.get()) print("Pressed ", VarHotkeyStageOne.get()) time.sleep(.15) elif VarCheckStageOne.get(): stage_one = VarPercentageStageOne.get() if stage_one > life or stage_one == life: self.SendToClient.Press(VarHotkeyStageOne.get()) print("Pressed ", VarHotkeyStageOne.get()) time.sleep(.15) elif VarCheckStageTwo.get(): stage_two = VarPercentageStageTwo.get() if stage_two > life or stage_two == life: self.SendToClient.Press(VarHotkeyStageTwo.get()) print("Pressed ", VarHotkeyStageTwo.get()) time.sleep(.15) elif VarCheckStageThree.get(): stage_three = VarPercentageStageThree.get() if stage_three > life or stage_three == life: self.SendToClient.Press(VarHotkeyStageThree.get()) print("Pressed ", VarHotkeyStageThree.get()) time.sleep(.15) elif VarCheckStageThree.get(): stage_three = VarPercentageStageThree.get() if stage_three > life or stage_three == life: self.SendToClient.Press(VarHotkeyStageThree.get()) print("Pressed ", VarHotkeyStageThree.get()) time.sleep(.15) else: print("Module Not Configured") time.sleep(1) VarCheckPrint = tk.BooleanVar() VarCheckBuff = tk.BooleanVar() VarCheckStageOne = tk.BooleanVar() VarCheckStageTwo = tk.BooleanVar() VarCheckStageThree = tk.BooleanVar() VarCheckCureStats = tk.BooleanVar() VarCheckParalyze = tk.BooleanVar() VarCheckPoison = tk.BooleanVar() VarCheckFire = tk.BooleanVar() VarCheckElectrify = tk.BooleanVar() VarCheckMort = tk.BooleanVar() VarCheckBlood = tk.BooleanVar() VarPercentageStageOne = tk.IntVar() VarPercentageStageOne.set(90) VarHotkeyStageOne = tk.StringVar() VarHotkeyStageOne.set("F1") VarPercentageStageTwo = tk.IntVar() VarPercentageStageTwo.set(75) VarHotkeyStageTwo = tk.StringVar() VarHotkeyStageTwo.set("F2") VarPercentageStageThree = tk.IntVar() VarPercentageStageThree.set(35) VarHotkeyStageThree = tk.StringVar() VarHotkeyStageThree.set("F12") ParalyzeImage = ImageTk.PhotoImage(Image.open('images/Stats/paralyze.webp')) PoisonImage = ImageTk.PhotoImage(Image.open('images/Stats/poison.webp')) FireImage = ImageTk.PhotoImage(Image.open('images/Stats/fire.webp')) ElectrifyImage = ImageTk.PhotoImage(Image.open('images/Stats/electrify.webp')) MortImage = ImageTk.PhotoImage(Image.open('images/Stats/mort.webp')) BloodImage = ImageTk.PhotoImage(Image.open('images/Stats/blood.webp')) self.AutoHeal.addButton('Ok', self.AutoHeal.destroyWindow, [73, 21], [115, 340]) ''' button enable healing ''' global EnabledAutoHeal if not EnabledAutoHeal: ButtonEnabled = self.AutoHeal.addButton('AutoHealing: OFF', SetAutoHeal, [287, 23], [11, 311]) else: ButtonEnabled = self.AutoHeal.addButton('AutoHealing: ON', SetAutoHeal, [287, 23], [11, 311]) ButtonEnabled.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) CheckPrint = self.AutoHeal.addCheck(VarCheckPrint, [11, 260], 0, "Print on Tibia's screen") CheckPrint.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) CheckBuff = self.AutoHeal.addCheck(VarCheckBuff, [11, 280], 0, "Don't Buff") CheckBuff.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) LabelPercentage = self.AutoHeal.addLabel('% Percentage', [145, 24]) LabelHotkey = self.AutoHeal.addLabel('HotKey', [230, 24]) StageOne = self.AutoHeal.addCheck(VarCheckStageOne, [17, 55], 0, "Enable Stage One") StageTwo = self.AutoHeal.addCheck(VarCheckStageTwo, [17, 105], 0, "Enable Stage Two") StageThree = self.AutoHeal.addCheck(VarCheckStageThree, [17, 155], 0, "Enable Stage Three") CheckStats = self.AutoHeal.addCheck(VarCheckCureStats, [95, 192], 0, "Enable Cure Stats") Paralyze = self.AutoHeal.addCheck(VarCheckParalyze, [40, 226], 0, '', ParalyzeImage) Poison = self.AutoHeal.addCheck(VarCheckPoison, [80, 226], 0, '', PoisonImage) Fire = self.AutoHeal.addCheck(VarCheckFire, [120, 226], 0, '', FireImage) Electrify = self.AutoHeal.addCheck(VarCheckElectrify, [160, 226], 0, '', ElectrifyImage) Mort = self.AutoHeal.addCheck(VarCheckMort, [200, 226], 0, '', MortImage) Blood = self.AutoHeal.addCheck(VarCheckBlood, [240, 226], 0, '', BloodImage) PercentageStageOne = self.AutoHeal.addOption(VarPercentageStageOne, percentage, [148, 54]) HotkeyStageOne = self.AutoHeal.addOption(VarHotkeyStageOne, self.SendToClient.Hotkeys, [223, 54]) PercentageStageTwo = self.AutoHeal.addOption(VarPercentageStageTwo, percentage, [148, 104]) HotkeyStageTwo = self.AutoHeal.addOption(VarHotkeyStageTwo, self.SendToClient.Hotkeys, [223, 104]) PercentageStageThree = self.AutoHeal.addOption(VarPercentageStageThree, percentage, [148, 154]) HotkeyStageThree = self.AutoHeal.addOption(VarHotkeyStageThree, self.SendToClient.Hotkeys, [223, 154]) def CheckingButtons(): if EnabledAutoHeal: CheckStats.configure(state='disabled') StageThree.configure(state='disabled') StageTwo.configure(state='disabled') StageOne.configure(state='disabled') LabelHotkey.configure(state='disabled') LabelPercentage.configure(state='disabled') PercentageStageOne.configure(state='disabled') HotkeyStageOne.configure(state='disabled') PercentageStageTwo.configure(state='disabled') HotkeyStageTwo.configure(state='disabled') PercentageStageThree.configure(state='disabled') HotkeyStageThree.configure(state='disabled') Paralyze.configure(state='disabled') Poison.configure(state='disabled') Fire.configure(state='disabled') Electrify.configure(state='disabled') Mort.configure(state='disabled') Blood.configure(state='disabled') CheckPrint.configure(state='disabled') CheckBuff.configure(state='disabled') else: CheckStats.configure(state='normal') StageThree.configure(state='normal') StageTwo.configure(state='normal') StageOne.configure(state='normal') LabelHotkey.configure(state='normal') LabelPercentage.configure(state='normal') PercentageStageOne.configure(state='normal') HotkeyStageOne.configure(state='normal') PercentageStageTwo.configure(state='normal') HotkeyStageTwo.configure(state='normal') PercentageStageThree.configure(state='normal') HotkeyStageThree.configure(state='normal') CheckPrint.configure(state='normal') CheckBuff.configure(state='normal') if not VarCheckCureStats.get(): Paralyze.configure(state='disabled') Poison.configure(state='disabled') Fire.configure(state='disabled') Electrify.configure(state='disabled') Mort.configure(state='disabled') Blood.configure(state='disabled') elif VarCheckCureStats.get(): Paralyze.configure(state='normal') Poison.configure(state='normal') Fire.configure(state='normal') Electrify.configure(state='normal') Mort.configure(state='normal') Blood.configure(state='normal') def ConstantVerify(): if not EnabledAutoHeal: if not VarCheckCureStats.get(): Paralyze.configure(state='disabled') Poison.configure(state='disabled') Fire.configure(state='disabled') Electrify.configure(state='disabled') Mort.configure(state='disabled') Blood.configure(state='disabled') elif VarCheckCureStats.get(): Paralyze.configure(state='normal') Poison.configure(state='normal') Fire.configure(state='normal') Electrify.configure(state='normal') Mort.configure(state='normal') Blood.configure(state='normal') self.AutoHeal.After(1, ConstantVerify) CheckingButtons() ConstantVerify() self.AutoHeal.loop()
class root: def __init__(self, CharName, LoadedJson): self.root = GUI('root', 'TibiaAuto V12') self.root.MainWindow('Main', [357, 530], [2, 2.36]) self.root.addMinimalLabel(f'Logged as: {CharName}', [14, 14]) self.root.addButton('Healer Friend', OpenHealerFriend, [92, 23], [23, 56]) self.root.addButton('Color Change', OpenColorChange, [92, 23], [23, 108]) self.root.addButton('Ammo Restack', OpenAmmoRestack, [92, 23], [23, 135]) self.root.addButton('Auto Looter', OpenAutoLooter, [92, 23], [23, 160]) self.root.addButton('Food Eater', OpenFoodEater, [92, 23], [23, 210]) self.root.addButton('Auto Grouping', OpenAutoGrouping, [92, 23], [23, 236]) self.root.addButton('Sort Loot', OpenSortLoot, [92, 23], [23, 262]) self.root.addButton('Auto Banker', OpenAutoBanker, [92, 23], [23, 288]) self.root.addButton('Auto Seller', OpenAutoSeller, [92, 23], [23, 340]) self.root.addButton('FPS Changer', OpenFPSChanger, [92, 23], [23, 366]) self.root.addButton('Auto Life', OpenAutoHeal, [92, 23], [147, 56]) self.root.addButton('Auto Hur', OpenAutoHur, [92, 23], [245, 56]) self.root.addButton('Auto Mana', OpenAutoMana, [92, 23], [147, 83]) self.root.addButton('Auto Fish', OpenAutoFish, [92, 23], [245, 83]) self.root.addButton('Auto Amulet', OpenAutoSSA, [92, 23], [147, 108]) self.root.addButton('Auto Ring', OpenAutoRing, [92, 23], [245, 108]) self.root.addButton('Timed Spells', OpenTimedSpells, [92, 23], [147, 135]) self.root.addButton('Auto Login', OpenAutoLogin, [92, 23], [245, 135]) self.root.addButton('Creature Info', OpenCreatureInfo, [92, 23], [147, 188]) self.root.addButton('Monsters', OpenMonsters, [92, 23], [245, 188]) self.root.addButton('Show Map', OpenAutoAttack, [92, 23], [147, 290]) self.root.addButton('Cave Bot', OpenCaveBot, [92, 23], [245, 290]) self.root.addButton('Load Config', OpenLoadConfig, [92, 23], [147, 340]) self.root.addButton('Save Config', OpenSaveConfig, [92, 23], [245, 340]) self.root.addButton('Adjust Config', OpenAdjustConfig, [92, 23], [147, 366]) self.root.addButton('Modules', OpenModules, [92, 23], [245, 366]) self.root.addButton('Python Scripts', OpenPythonScripts, [92, 23], [245, 392]) self.root.addButton('General Options', OpenGeneralOptions, [213, 23], [134, 426]) self.root.addButton('Exit', Exit, [92, 23], [10, 498]) def SetVariablesFromLoadedJson(): global SETTED_VARIABLES if not SETTED_VARIABLES: with open('Scripts/' + LoadedJson + '.json', 'r') as LoadsJson: data = json.load(LoadsJson) global MOUSE_OPTION MOUSE_OPTION = data['MouseOption'] if MOUSE_OPTION == 0: print("Your Mouse Option Is: Send Events To Client") else: print("Your Mouse Option Is: Movement Mouse") global HOOK_OPTION HOOK_OPTION = data['HookOption'] if HOOK_OPTION == 0: print("Your Hook Option Is: Grab Window Screen") else: print("Your Hook Option Is: Hook Directly OBS") if data['Positions']['LifePosition'][0]['Stats']: HealthLocation[0] = data['Positions']['LifePosition'][0][ 'x'] HealthLocation[1] = data['Positions']['LifePosition'][0][ 'y'] if data['Positions']['ManaPosition'][0]['Stats']: ManaLocation[0] = data['Positions']['ManaPosition'][0]['x'] ManaLocation[1] = data['Positions']['ManaPosition'][0]['y'] if data['Boxes']['BattleBox'][0]['Stats']: BattlePositions[0] = data['Boxes']['BattleBox'][0]['x'] - 3 BattlePositions[1] = data['Boxes']['BattleBox'][0]['y'] - 3 BattlePositions[2] = data['Boxes']['BattleBox'][0]['w'] + 3 BattlePositions[3] = data['Boxes']['BattleBox'][0]['h'] + 3 if data['Boxes']['StatusBarBox'][0]['Stats']: StatsPositions[ 0] = data['Boxes']['StatusBarBox'][0]['x'] - 1 StatsPositions[ 1] = data['Boxes']['StatusBarBox'][0]['y'] - 1 StatsPositions[2] = data['Boxes']['StatusBarBox'][0]['w'] StatsPositions[3] = data['Boxes']['StatusBarBox'][0]['h'] if data['Boxes']['RingBox'][0]['Stats']: RingPositions[0] = data['Boxes']['RingBox'][0]['x'] RingPositions[1] = data['Boxes']['RingBox'][0]['y'] RingPositions[2] = data['Boxes']['RingBox'][0]['w'] RingPositions[3] = data['Boxes']['RingBox'][0]['h'] if data['Boxes']['AmuletBox'][0]['Stats']: AmuletPositions[0] = data['Boxes']['AmuletBox'][0]['x'] AmuletPositions[1] = data['Boxes']['AmuletBox'][0]['y'] AmuletPositions[2] = data['Boxes']['AmuletBox'][0]['w'] AmuletPositions[3] = data['Boxes']['AmuletBox'][0]['h'] if data['Boxes']['MapBox'][0]['Stats']: MapPositions[0] = data['Boxes']['MapBox'][0]['x'] + 1 MapPositions[1] = data['Boxes']['MapBox'][0]['y'] + 1 MapPositions[2] = data['Boxes']['MapBox'][0]['w'] MapPositions[3] = data['Boxes']['MapBox'][0]['h'] + 1 if data['Positions']['PlayerPosition'][0]['Stats'] and data[ 'Boxes']['GameWindowBox'][0]['Stats']: gameWindow[0] = data['Boxes']['GameWindowBox'][0]['x'] gameWindow[1] = data['Boxes']['GameWindowBox'][0]['y'] gameWindow[2] = data['Boxes']['GameWindowBox'][0]['w'] gameWindow[3] = data['Boxes']['GameWindowBox'][0]['h'] Player[0] = data['Positions']['PlayerPosition'][0]['x'] Player[1] = data['Positions']['PlayerPosition'][0]['y'] if data['SQM']['SQM1'][0]['Stats'] and data['SQM']['SQM2'][0][ 'Stats'] and data['SQM']['SQM3'][0]['Stats'] and data[ 'SQM']['SQM4'][0]['Stats'] and data['SQM']['SQM5'][ 0]['Stats'] and data['SQM']['SQM6'][0][ 'Stats'] and data['SQM']['SQM7'][0][ 'Stats'] and data['SQM']['SQM8'][0][ 'Stats'] and data['SQM']['SQM9'][ 0]['Stats']: SQMs[0] = data['SQM']['SQM1'][0]['x'] SQMs[1] = data['SQM']['SQM1'][0]['y'] SQMs[2] = data['SQM']['SQM2'][0]['x'] SQMs[3] = data['SQM']['SQM2'][0]['y'] SQMs[4] = data['SQM']['SQM3'][0]['x'] SQMs[5] = data['SQM']['SQM3'][0]['y'] SQMs[6] = data['SQM']['SQM4'][0]['x'] SQMs[7] = data['SQM']['SQM4'][0]['y'] SQMs[8] = data['SQM']['SQM5'][0]['x'] SQMs[9] = data['SQM']['SQM5'][0]['y'] SQMs[10] = data['SQM']['SQM6'][0]['x'] SQMs[11] = data['SQM']['SQM6'][0]['y'] SQMs[12] = data['SQM']['SQM7'][0]['x'] SQMs[13] = data['SQM']['SQM7'][0]['y'] SQMs[14] = data['SQM']['SQM8'][0]['x'] SQMs[15] = data['SQM']['SQM8'][0]['y'] SQMs[16] = data['SQM']['SQM9'][0]['x'] SQMs[17] = data['SQM']['SQM9'][0]['y'] SETTED_VARIABLES = True SetVariablesFromLoadedJson() self.root.loop()
class CaveBot: def __init__(self, root, MapPositions, BattlePositions, SQMs, MOUSE_OPTION, HOOK_OPTION): self.CaveBot = GUI('CaveBot', 'Module: Cave Bot') self.CaveBot.DefaultWindow('CaveBot', [830, 634], [1.2, 2.29]) def SetCaveBot(): global EnabledCaveBot if not EnabledCaveBot: EnabledCaveBot = True ButtonEnabled.configure(text='CaveBot: ON', relief=SUNKEN, bg=rgb((158, 46, 34))) CheckingButtons() InitScan() else: EnabledCaveBot = False CheckingButtons() ButtonEnabled.configure(text='CaveBot: OFF', relief=RAISED, bg=rgb((127, 17, 8))) def InitScan(): global data, monster with open('Scripts/' + Script.get() + '.json', 'r') as rJson: data = json.load(rJson) print("The Script " + Script.get() + ".json Have a", len(data), "Marks") monster = SelectedMonster.get() try: ThreadCaveBot = threading.Thread(target=ScanCaveBot) ThreadCaveBot.start() except: print("Error: Unable To Start ThreadCaveBot!") def ScanCaveBot(): global data, monster while EnabledCaveBot: for i in range(len(data)): EngineCaveBot(data, i, MapPositions, BattlePositions, monster, SQMs, MOUSE_OPTION, HOOK_OPTION, Script.get()) time.sleep(1) def CheckClick(): Checking() CheckDebugging = tk.BooleanVar() CheckHotkeyPause = tk.BooleanVar() CheckHotkeyPause.set(True) HotkeyToPause = tk.StringVar() HotkeyToPause.set('Page Up') Script = tk.StringVar() Script.set(DefaultScript) BackImage = 'images/Fundo.png' Back = self.CaveBot.openImage(BackImage, [210, 60]) Back2 = self.CaveBot.openImage(BackImage, [210, 100]) self.CaveBot.addButton('Ok', self.CaveBot.destroyWindow, [74, 22], [378, 601]) global EnabledCaveBot if not EnabledCaveBot: ButtonEnabled = self.CaveBot.addButton('CaveBot: OFF', SetCaveBot, [810, 26], [10, 570]) else: ButtonEnabled = self.CaveBot.addButton('CaveBot: ON', SetCaveBot, [810, 26], [10, 570]) CheckboxDebugging = self.CaveBot.addCheck(CheckDebugging, [434, 484], 0, "Enable Cavebot Debugging") CheckboxHotkeyPause = self.CaveBot.addCheck( CheckHotkeyPause, [434, 526], 1, 'Enable Hotkey To Break a Cavebot') CheckboxHotkeyPause.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) ButtonHotkeyPause = self.CaveBot.addOption(HotkeyToPause, Hotkeys, [644, 526], 8) # region Functions Walker def ValidateRadius(*args): s = Radius.get() if len(s) > 2: if not s[-1].isdigit(): Radius.set(s[:-1]) else: Radius.set(s[:2]) def ValidateDelay(*args): s = Delay.get() if len(s) > 1: if not s[-1].isdigit(): Delay.set(s[:-1]) else: Delay.set(s[:1]) def ValidateWaypoint_X(*args): s = Waypoint_X.get() if len(s) > 5: if not s[-1].isdigit(): Waypoint_X.set(s[:-1]) else: Waypoint_X.set(s[:5]) def ValidateWaypoint_Y(*args): s = Waypoint_Y.get() if len(s) > 5: if not s[-1].isdigit(): Waypoint_Y.set(s[:-1]) else: Waypoint_Y.set(s[:5]) def ValidateWaypoint_Z(*args): s = Waypoint_Z.get() if len(s) > 2: if not s[-1].isdigit(): Waypoint_Z.set(s[:-1]) else: Waypoint_Z.set(s[:2]) def ValidateStand(*args): s = Stand.get() if len(s) > 1: if not s[-1].isdigit(): Stand.set(s[:-1]) else: Stand.set(s[:1]) def SetResearchMap(): if not ResearchMap.get(): ResearchMap.set(True) ButtonResearchMap.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) else: ResearchMap.set(False) ButtonResearchMap.configure(relief=RAISED, bg=rgb((127, 17, 8))) def RemoveWalker(): print('Clicked on remove wlaker') def AddWalker(): print('Clicked on add walker') def CheckMarkClick(): print('Check Mark Click') # endregion # region Functions MonstersAttacking def AddMonsterAttack(): print('AddMonsterAttack') def RemoveMonsterAttack(): print('RemoveMonsterAttack') def AddMonsterIgnore(): print('AddMonsterIgnore') def RemoveMonsterIgnore(): print('RemoveMonsterIgnore') def UpMonsterAttack(): print('UpMonsterAttack') def DownMonsterAttack(): print('DownMonsterAttack') def ValidateSuspendAfter(*args): s = SuspendAfter.get() if len(s) > 2: if not s[-1].isdigit(): SuspendAfter.set(s[:-1]) else: SuspendAfter.set(s[:2]) def ValidateMonstersRange(*args): s = MonstersRange.get() if len(s) > 2: if not s[-1].isdigit(): MonstersRange.set(s[:-1]) else: MonstersRange.set(s[:2]) # endregion # region Functions DepotWalker def SetLoadAutoSeller(): if not LoadAutoSeller.get(): LoadAutoSeller.set(True) ButtonAutoSeller.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) else: LoadAutoSeller.set(False) ButtonAutoSeller.configure(relief=RAISED, bg=rgb((127, 17, 8))) def SetLoadAutoBanker(): if not LoadAutoBanker.get(): LoadAutoBanker.set(True) ButtonAutoBanker.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) else: LoadAutoBanker.set(False) ButtonAutoBanker.configure(relief=RAISED, bg=rgb((127, 17, 8))) def SetLoadSortLoot(): if not LoadSortLoot.get(): LoadSortLoot.set(True) ButtonSortLoot.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) else: LoadSortLoot.set(False) ButtonSortLoot.configure(relief=RAISED, bg=rgb((127, 17, 8))) # endregion # region Variables MonsterAttacking PriorityOne = tk.IntVar() PriorityOne.set(priority[0]) PriorityTwo = tk.IntVar() PriorityTwo.set(priority[1]) PriorityThree = tk.IntVar() PriorityThree.set(priority[2]) PriorityFour = tk.IntVar() PriorityFour.set(priority[3]) SelectedMonster = tk.StringVar() SelectedMonster.set(monsters[0]) SelectedMonster2 = tk.StringVar() SelectedMonster2.set(monsters[1]) SelectedMonster3 = tk.StringVar() SelectedMonster3.set(monsters[2]) SelectedMonster4 = tk.StringVar() SelectedMonster4.set(monsters[3]) SelectedAttackMode = tk.StringVar() SelectedAttackMode.set(AttackModes[0]) CheckAttackOne = tk.BooleanVar() CheckAttackOne.set(True) CheckAttackTwo = tk.BooleanVar() CheckAttackTwo.set(False) CheckAttackThree = tk.BooleanVar() CheckAttackThree.set(False) CheckAttackFour = tk.BooleanVar() CheckAttackFour.set(False) CheckFollow = tk.BooleanVar() CheckCantAttack = tk.BooleanVar() CheckAttackPlayers = tk.BooleanVar() CheckPlayerSeen = tk.BooleanVar() CheckAttackingYou = tk.BooleanVar() CheckForceAttack = tk.BooleanVar() SuspendAfter = tk.StringVar() SuspendAfter.set('15') MonstersRange = tk.StringVar() MonstersRange.set('6') # endregion # region Variables Walker RadioCavebotMode = tk.IntVar() RadioCavebotMode.set(0) Radius = tk.StringVar() Radius.set('1') Delay = tk.StringVar() Delay.set('0') Waypoint_X = tk.StringVar() # Lembrar de setar posição atual do player Waypoint_X.set('32350') Waypoint_Y = tk.StringVar() # Lembrar de setar posição atual do player Waypoint_Y.set('32219') Waypoint_Z = tk.StringVar() # Lembrar de setar posição atual do player Waypoint_Z.set('6') Stand = tk.StringVar() Stand.set('2') ResearchMap = tk.BooleanVar() ResearchMap.set(True) ImageMark1 = ImageTk.PhotoImage( Image.open('images/MapSettings/CheckMark.png')) ImageMark2 = ImageTk.PhotoImage( Image.open('images/MapSettings/QuestionMark.png')) ImageMark3 = ImageTk.PhotoImage( Image.open('images/MapSettings/ExclimationMark.png')) ImageMark4 = ImageTk.PhotoImage( Image.open('images/MapSettings/Star.png')) ImageMark5 = ImageTk.PhotoImage( Image.open('images/MapSettings/Cross.png')) ImageMark6 = ImageTk.PhotoImage( Image.open('images/MapSettings/Church.png')) ImageMark7 = ImageTk.PhotoImage( Image.open('images/MapSettings/Mouth.png')) ImageMark8 = ImageTk.PhotoImage( Image.open('images/MapSettings/Shovel.png')) ImageMark9 = ImageTk.PhotoImage( Image.open('images/MapSettings/Sword.png')) ImageMark10 = ImageTk.PhotoImage( Image.open('images/MapSettings/Flag.png')) ImageMark11 = ImageTk.PhotoImage( Image.open('images/MapSettings/Lock.png')) ImageMark12 = ImageTk.PhotoImage( Image.open('images/MapSettings/Bag.png')) ImageMark13 = ImageTk.PhotoImage( Image.open('images/MapSettings/Skull.png')) ImageMark14 = ImageTk.PhotoImage( Image.open('images/MapSettings/Money.png')) ImageMark15 = ImageTk.PhotoImage( Image.open('images/MapSettings/ArrowUp.png')) ImageMark16 = ImageTk.PhotoImage( Image.open('images/MapSettings/ArrowDown.png')) ImageMark17 = ImageTk.PhotoImage( Image.open('images/MapSettings/ArrowRight.png')) ImageMark18 = ImageTk.PhotoImage( Image.open('images/MapSettings/ArrowLeft.png')) ImageMark19 = ImageTk.PhotoImage( Image.open('images/MapSettings/Above.png')) ImageMark20 = ImageTk.PhotoImage( Image.open('images/MapSettings/Bellow.png')) RadioMarkValue = tk.IntVar() RadioMarkValue.set(1) # endregion # region Variables DepotWalker CheckDropItems = tk.BooleanVar() CheckDropItems.set(True) LoadAutoSeller = tk.BooleanVar() LoadAutoSeller.set(True) LoadAutoBanker = tk.BooleanVar() LoadAutoBanker.set(True) LoadSortLoot = tk.BooleanVar() LoadSortLoot.set(True) CapBelowThan = tk.StringVar() CapBelowThan.set('150') # endregion # region Variables CorpseLooting CheckLootWhileKilling = tk.BooleanVar() CheckLootWhileKilling.set(True) CheckTibiaCustomLoot = tk.BooleanVar() CheckTibiaCustomLoot.set(True) CheckSQM1 = tk.StringVar() CheckSQM1.set(True) CheckSQM2 = tk.StringVar() CheckSQM2.set(True) CheckSQM3 = tk.StringVar() CheckSQM3.set(True) CheckSQM4 = tk.StringVar() CheckSQM4.set(True) CheckSQM5 = tk.StringVar() CheckSQM5.set(True) CheckSQM6 = tk.StringVar() CheckSQM6.set(True) CheckSQM7 = tk.StringVar() CheckSQM7.set(True) CheckSQM8 = tk.StringVar() CheckSQM8.set(True) CheckSQM9 = tk.StringVar() CheckSQM9.set(True) CapLimit = tk.StringVar() CapLimit.set('50') # endregion # region GUI MonsterAttacking OptionAttackMode = self.CaveBot.addOption(SelectedAttackMode, AttackModes, [103, 328], 10) CheckboxAttackOne = self.CaveBot.addCheck(CheckAttackOne, [25, 40], 1, 'Monster One') OptionMonstersOne = self.CaveBot.addOption(SelectedMonster, monsters, [155, 40], 16) PriorityMonstersOne = self.CaveBot.addOption(PriorityOne, priority, [300, 40]) CheckboxAttackTwo = self.CaveBot.addCheck(CheckAttackTwo, [25, 80], 0, 'Monster Two') OptionMonstersTwo = self.CaveBot.addOption(SelectedMonster2, monsters, [155, 80], 16) PriorityMonstersTwo = self.CaveBot.addOption(PriorityTwo, priority, [300, 80]) CheckboxAttackThree = self.CaveBot.addCheck(CheckAttackThree, [25, 120], 0, 'Monster Three') OptionMonstersThree = self.CaveBot.addOption(SelectedMonster3, monsters, [155, 120], 16) PriorityMonstersThree = self.CaveBot.addOption(PriorityThree, priority, [300, 120]) CheckboxAttackFour = self.CaveBot.addCheck(CheckAttackFour, [25, 160], 0, 'Monster Four') OptionMonstersFour = self.CaveBot.addOption(SelectedMonster4, monsters, [155, 160], 16) PriorityMonstersFour = self.CaveBot.addOption(PriorityFour, priority, [300, 160]) CheckBoxFollow = self.CaveBot.addCheck(CheckFollow, [20, 200], 1, 'Auto Follow Mode') CheckBoxCantAttack = self.CaveBot.addCheck( CheckCantAttack, [20, 220], 1, "Suspend When Can't Attack") CheckBoxAttackPlayers = self.CaveBot.addCheck(CheckAttackPlayers, [20, 240], 1, "Don't Attack Players") CheckBoxPlayerSeen = self.CaveBot.addCheck( CheckPlayerSeen, [195, 200], 1, 'Reduced Attack When Player Seen') CheckBoxAttackingYou = self.CaveBot.addCheck( CheckAttackingYou, [183, 240], 0, 'Attack Only Monsters Attacking You') CheckBoxForceAttack = self.CaveBot.addCheck( CheckForceAttack, [195, 220], 0, 'Force Attack When Attacked') LabelSuspendAfter = self.CaveBot.addLabel('Suspend After Unreachable:', [100, 280]) LabelMonstersRange = self.CaveBot.addLabel( 'Consider Monsters In Range:', [100, 300]) LabelAttackMode = self.CaveBot.addLabel('Attack Mode:', [20, 331]) EntrySuspendAfter = self.CaveBot.addEntry([270, 280], SuspendAfter, 5) SuspendAfter.trace("w", ValidateSuspendAfter) EntryMonstersRange = self.CaveBot.addEntry([270, 300], MonstersRange, 5) MonstersRange.trace("w", ValidateMonstersRange) # endregion # region GUI Walker RadioWaypoint = self.CaveBot.addRadio('Waypoints', RadioCavebotMode, 0, [26, 414], CheckClick) RadioMark = self.CaveBot.addRadio('Marks', RadioCavebotMode, 1, [115, 414], CheckClick) LabelStand = self.CaveBot.addLabel( 'Stand Still After Reaching Waypoint For:', [24, 520]) ButtonResearchMap = self.CaveBot.addButton('Auto Research Map', SetResearchMap, [130, 37], [268, 513]) # endregion # region GUI DepotWalker CheckboxDropItems = self.CaveBot.addCheck( CheckDropItems, [425, 28], 1, 'Drop Items Instead Of Deposit') LabelGoDepot = self.CaveBot.addLabel( 'Go To Depot When Cap Below Than:', [480, 50]) EntryCapBelowThan = self.CaveBot.addEntry([680, 50], CapBelowThan, 5) ButtonAutoSeller = self.CaveBot.addButton('Load AutoSeller', SetLoadAutoSeller, [110, 28], [450, 80]) ButtonAutoBanker = self.CaveBot.addButton('Load AutoBanker', SetLoadAutoBanker, [120, 28], [570, 80]) ButtonSortLoot = self.CaveBot.addButton('Load SortLoot', SetLoadSortLoot, [100, 28], [700, 80]) # endregion # region GUI CorpseLooting LabelCapLimit = self.CaveBot.addLabel('Loot Capacity Limit:', [435, 150]) EntryCapLimit = self.CaveBot.addEntry([551, 148], CapLimit, 5) CheckBoxLootWhileKilling = self.CaveBot.addCheck( CheckLootWhileKilling, [435, 180], 1, 'Loot While Killing') CheckBoxTibiaCustomLoot = self.CaveBot.addCheck( CheckTibiaCustomLoot, [585, 180], 1, 'Loot From Tibia Custom Loot') LabelLootAround = self.CaveBot.addLabel('Configure Loot Around:', [545, 220]) CheckBoxSQM1 = self.CaveBot.addCheck(CheckSQM1, [570, 310], 1) CheckBoxSQM2 = self.CaveBot.addCheck(CheckSQM2, [600, 310], 1) CheckBoxSQM3 = self.CaveBot.addCheck(CheckSQM3, [630, 310], 1) CheckBoxSQM4 = self.CaveBot.addCheck(CheckSQM4, [570, 280], 1) CheckBoxSQM5 = self.CaveBot.addCheck(CheckSQM5, [600, 280], 1) CheckBoxSQM6 = self.CaveBot.addCheck(CheckSQM6, [630, 280], 1) CheckBoxSQM7 = self.CaveBot.addCheck(CheckSQM7, [570, 250], 1) CheckBoxSQM8 = self.CaveBot.addCheck(CheckSQM8, [600, 250], 1) CheckBoxSQM9 = self.CaveBot.addCheck(CheckSQM9, [630, 250], 1) # endregion def Checking(): if RadioCavebotMode.get() == 0: print('Walker Mode:', RadioCavebotMode.get()) self.CaveBot.addImage(Back, [23, 440]) self.CaveBot.addImage(Back, [23, 450]) self.CaveBot.addImage(Back2, [197, 405]) LabelWaypoints = self.CaveBot.addLabel('Waypoints:', [236, 402]) LabelRadius = self.CaveBot.addLabel('Radius:', [24, 451]) LabelDelay = self.CaveBot.addLabel('Delay:', [111, 451]) EntryRadius = self.CaveBot.addEntry([70, 452], Radius, 5) Radius.trace("w", ValidateRadius) EntryDelay = self.CaveBot.addEntry([154, 452], Delay, 5) Delay.trace("w", ValidateDelay) LabelWaypointX = self.CaveBot.addLabel('X:', [26, 479]) EntryWaypointX = self.CaveBot.addEntry([42, 480], Waypoint_X, 5) Waypoint_X.trace("w", ValidateWaypoint_X) LabelWaypointY = self.CaveBot.addLabel('Y:', [81, 479]) EntryWaypointY = self.CaveBot.addEntry([97, 480], Waypoint_Y, 5) Waypoint_Y.trace("w", ValidateWaypoint_Y) LabelWaypointZ = self.CaveBot.addLabel('Z:', [135, 479]) EntryWaypointZ = self.CaveBot.addEntry([151, 480], Waypoint_Z, 5) Waypoint_Z.trace("w", ValidateWaypoint_Z) EntryStand = self.CaveBot.addEntry([244, 520], Stand, 2) Stand.trace("w", ValidateStand) ButtonRemoveWalker = self.CaveBot.addButton( '<<<', RemoveWalker, [29, 23], [197, 424]) ButtonAddWalker = self.CaveBot.addButton( '>>>', AddWalker, [29, 23], [197, 479]) if EnabledCaveBot: LabelWaypoints.configure(state='disabled') LabelRadius.configure(state='disabled') LabelDelay.configure(state='disabled') EntryRadius.configure(state='disabled') EntryDelay.configure(state='disabled') LabelWaypointX.configure(state='disabled') EntryWaypointX.configure(state='disabled') LabelWaypointY.configure(state='disabled') EntryWaypointY.configure(state='disabled') LabelWaypointZ.configure(state='disabled') EntryWaypointZ.configure(state='disabled') EntryStand.configure(state='disabled') ButtonResearchMap.configure(state='disabled') ButtonRemoveWalker.configure(state='disabled') ButtonAddWalker.configure(state='disabled') else: LabelWaypoints.configure(state='normal') LabelRadius.configure(state='normal') LabelDelay.configure(state='normal') EntryRadius.configure(state='normal') EntryDelay.configure(state='normal') LabelWaypointX.configure(state='normal') EntryWaypointX.configure(state='normal') LabelWaypointY.configure(state='normal') EntryWaypointY.configure(state='normal') LabelWaypointZ.configure(state='normal') EntryWaypointZ.configure(state='normal') EntryStand.configure(state='normal') ButtonResearchMap.configure(state='normal') ButtonRemoveWalker.configure(state='normal') ButtonAddWalker.configure(state='normal') elif RadioCavebotMode.get() == 1: print('Walker Mode:', RadioCavebotMode.get()) self.CaveBot.addImage(Back, [23, 450]) self.CaveBot.addImage(Back2, [197, 405]) LabelWaypoints = self.CaveBot.addLabel('Marks:', [246, 402]) self.CaveBot.addRadioImage('', RadioMarkValue, 1, [24, 441], CheckMarkClick, ImageMark1) self.CaveBot.addRadioImage('', RadioMarkValue, 2, [54, 441], CheckMarkClick, ImageMark2) self.CaveBot.addRadioImage('', RadioMarkValue, 3, [84, 441], CheckMarkClick, ImageMark3) self.CaveBot.addRadioImage('', RadioMarkValue, 4, [114, 441], CheckMarkClick, ImageMark4) self.CaveBot.addRadioImage('', RadioMarkValue, 5, [144, 441], CheckMarkClick, ImageMark5) self.CaveBot.addRadioImage('', RadioMarkValue, 6, [174, 441], CheckMarkClick, ImageMark6) self.CaveBot.addRadioImage('', RadioMarkValue, 7, [204, 441], CheckMarkClick, ImageMark7) self.CaveBot.addRadioImage('', RadioMarkValue, 8, [24, 461], CheckMarkClick, ImageMark8) self.CaveBot.addRadioImage('', RadioMarkValue, 9, [54, 461], CheckMarkClick, ImageMark9) self.CaveBot.addRadioImage('', RadioMarkValue, 0, [84, 461], CheckMarkClick, ImageMark10) self.CaveBot.addRadioImage('', RadioMarkValue, 11, [114, 461], CheckMarkClick, ImageMark11) self.CaveBot.addRadioImage('', RadioMarkValue, 12, [144, 461], CheckMarkClick, ImageMark12) self.CaveBot.addRadioImage('', RadioMarkValue, 13, [174, 461], CheckMarkClick, ImageMark13) self.CaveBot.addRadioImage('', RadioMarkValue, 14, [204, 461], CheckMarkClick, ImageMark14) self.CaveBot.addRadioImage('', RadioMarkValue, 15, [24, 481], CheckMarkClick, ImageMark15) self.CaveBot.addRadioImage('', RadioMarkValue, 16, [54, 481], CheckMarkClick, ImageMark16) self.CaveBot.addRadioImage('', RadioMarkValue, 17, [84, 481], CheckMarkClick, ImageMark17) self.CaveBot.addRadioImage('', RadioMarkValue, 18, [114, 481], CheckMarkClick, ImageMark18) self.CaveBot.addRadioImage('', RadioMarkValue, 19, [144, 481], CheckMarkClick, ImageMark19) self.CaveBot.addRadioImage('', RadioMarkValue, 20, [174, 481], CheckMarkClick, ImageMark20) if EnabledCaveBot: LabelWaypoints.configure(state='disabled') else: LabelWaypoints.configure(state='normal') def CheckingButtons(): if EnabledCaveBot: CheckboxDebugging.configure(state='disabled') CheckboxHotkeyPause.configure(state='disabled') ButtonHotkeyPause.configure(state='disabled') OptionAttackMode.configure(state='disabled') CheckboxAttackOne.configure(state='disabled') OptionMonstersOne.configure(state='disabled') PriorityMonstersOne.configure(state='disabled') CheckboxAttackTwo.configure(state='disabled') OptionMonstersTwo.configure(state='disabled') PriorityMonstersTwo.configure(state='disabled') CheckboxAttackThree.configure(state='disabled') OptionMonstersThree.configure(state='disabled') PriorityMonstersThree.configure(state='disabled') CheckboxAttackFour.configure(state='disabled') OptionMonstersFour.configure(state='disabled') PriorityMonstersFour.configure(state='disabled') CheckBoxFollow.configure(state='disabled') CheckBoxCantAttack.configure(state='disabled') CheckBoxAttackPlayers.configure(state='disabled') CheckBoxPlayerSeen.configure(state='disabled') CheckBoxAttackingYou.configure(state='disabled') CheckBoxForceAttack.configure(state='disabled') LabelSuspendAfter.configure(state='disabled') LabelMonstersRange.configure(state='disabled') LabelAttackMode.configure(state='disabled') EntrySuspendAfter.configure(state='disabled') EntryMonstersRange.configure(state='disabled') RadioWaypoint.configure(state='disabled') RadioMark.configure(state='disabled') LabelStand.configure(state='disabled') CheckboxDropItems.configure(state='disabled') LabelGoDepot.configure(state='disabled') EntryCapBelowThan.configure(state='disabled') ButtonAutoSeller.configure(state='disabled') ButtonAutoBanker.configure(state='disabled') ButtonSortLoot.configure(state='disabled') LabelCapLimit.configure(state='disabled') EntryCapLimit.configure(state='disabled') CheckBoxLootWhileKilling.configure(state='disabled') CheckBoxTibiaCustomLoot.configure(state='disabled') LabelLootAround.configure(state='disabled') CheckBoxSQM1.configure(state='disabled') CheckBoxSQM2.configure(state='disabled') CheckBoxSQM3.configure(state='disabled') CheckBoxSQM4.configure(state='disabled') CheckBoxSQM5.configure(state='disabled') CheckBoxSQM6.configure(state='disabled') CheckBoxSQM7.configure(state='disabled') CheckBoxSQM8.configure(state='disabled') CheckBoxSQM9.configure(state='disabled') else: CheckboxDebugging.configure(state='normal') CheckboxHotkeyPause.configure(state='normal') ButtonHotkeyPause.configure(state='normal') OptionAttackMode.configure(state='normal') CheckboxAttackOne.configure(state='normal') CheckboxAttackTwo.configure(state='normal') CheckboxAttackThree.configure(state='normal') CheckboxAttackFour.configure(state='normal') if not CheckAttackOne.get(): OptionMonstersOne.configure(state='disabled') PriorityMonstersOne.configure(state='disabled') else: OptionMonstersOne.configure(state='normal') PriorityMonstersOne.configure(state='normal') if not CheckAttackTwo.get(): OptionMonstersTwo.configure(state='disabled') PriorityMonstersTwo.configure(state='disabled') else: OptionMonstersTwo.configure(state='normal') PriorityMonstersTwo.configure(state='normal') if not CheckAttackThree.get(): OptionMonstersThree.configure(state='disabled') PriorityMonstersThree.configure(state='disabled') else: OptionMonstersThree.configure(state='normal') PriorityMonstersThree.configure(state='normal') if not CheckAttackFour.get(): OptionMonstersFour.configure(state='disabled') PriorityMonstersFour.configure(state='disabled') else: OptionMonstersFour.configure(state='normal') PriorityMonstersFour.configure(state='normal') CheckBoxFollow.configure(state='normal') CheckBoxCantAttack.configure(state='normal') CheckBoxAttackPlayers.configure(state='normal') CheckBoxPlayerSeen.configure(state='normal') CheckBoxAttackingYou.configure(state='normal') CheckBoxForceAttack.configure(state='normal') LabelSuspendAfter.configure(state='normal') LabelMonstersRange.configure(state='normal') LabelAttackMode.configure(state='normal') EntrySuspendAfter.configure(state='normal') EntryMonstersRange.configure(state='normal') RadioWaypoint.configure(state='normal') RadioMark.configure(state='normal') LabelStand.configure(state='normal') CheckboxDropItems.configure(state='normal') if CheckDropItems.get(): LabelGoDepot.configure(state='disabled') EntryCapBelowThan.configure(state='disabled') ButtonAutoSeller.configure(state='disabled') ButtonAutoBanker.configure(state='disabled') ButtonSortLoot.configure(state='disabled') else: LabelGoDepot.configure(state='normal') EntryCapBelowThan.configure(state='normal') ButtonAutoSeller.configure(state='normal') ButtonAutoBanker.configure(state='normal') ButtonSortLoot.configure(state='normal') LabelCapLimit.configure(state='normal') EntryCapLimit.configure(state='normal') CheckBoxLootWhileKilling.configure(state='normal') CheckBoxTibiaCustomLoot.configure(state='normal') LabelLootAround.configure(state='normal') CheckBoxSQM1.configure(state='normal') CheckBoxSQM2.configure(state='normal') CheckBoxSQM3.configure(state='normal') CheckBoxSQM4.configure(state='normal') CheckBoxSQM5.configure(state='normal') CheckBoxSQM6.configure(state='normal') CheckBoxSQM7.configure(state='normal') CheckBoxSQM8.configure(state='normal') CheckBoxSQM9.configure(state='normal') if ResearchMap.get(): ButtonResearchMap.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) else: ButtonResearchMap.configure(relief=RAISED, bg=rgb((127, 17, 8))) if LoadAutoSeller.get(): ButtonAutoSeller.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) else: ButtonAutoSeller.configure(relief=RAISED, bg=rgb((127, 17, 8))) if LoadAutoBanker.get(): ButtonAutoBanker.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) else: ButtonAutoBanker.configure(relief=RAISED, bg=rgb((127, 17, 8))) if LoadSortLoot.get(): ButtonSortLoot.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) else: ButtonSortLoot.configure(relief=RAISED, bg=rgb((127, 17, 8))) def ConstantVerify(): if not EnabledCaveBot: if not CheckAttackOne.get(): OptionMonstersOne.configure(state='disabled') PriorityMonstersOne.configure(state='disabled') else: OptionMonstersOne.configure(state='normal') PriorityMonstersOne.configure(state='normal') if not CheckAttackTwo.get(): OptionMonstersTwo.configure(state='disabled') PriorityMonstersTwo.configure(state='disabled') else: OptionMonstersTwo.configure(state='normal') PriorityMonstersTwo.configure(state='normal') if not CheckAttackThree.get(): OptionMonstersThree.configure(state='disabled') PriorityMonstersThree.configure(state='disabled') else: OptionMonstersThree.configure(state='normal') PriorityMonstersThree.configure(state='normal') if not CheckAttackFour.get(): OptionMonstersFour.configure(state='disabled') PriorityMonstersFour.configure(state='disabled') else: OptionMonstersFour.configure(state='normal') PriorityMonstersFour.configure(state='normal') if CheckDropItems.get(): LabelGoDepot.configure(state='disabled') EntryCapBelowThan.configure(state='disabled') ButtonAutoSeller.configure(state='disabled') ButtonAutoBanker.configure(state='disabled') ButtonSortLoot.configure(state='disabled') else: LabelGoDepot.configure(state='normal') EntryCapBelowThan.configure(state='normal') ButtonAutoSeller.configure(state='normal') ButtonAutoBanker.configure(state='normal') ButtonSortLoot.configure(state='normal') if not CheckHotkeyPause.get(): ButtonHotkeyPause.configure(state='disabled') elif CheckHotkeyPause.get(): ButtonHotkeyPause.configure(state='normal') self.CaveBot.After(300, ConstantVerify) CheckingButtons() ConstantVerify() Checking() self.CaveBot.loop()
class ChooseConfig: def __init__(self, CharName): self.ChooseConfig = GUI('ChooseConfig', 'Choose You Config') self.ChooseConfig.MainWindow('Config', [414, 202], [2, 2.36]) def CreateDefaultJson(): ScriptToLoad = NameCreateJson.get() if os.path.isfile('Scripts/' + 'Scripts/' + ScriptToLoad + '.json'): with open('Scripts/' + 'Scripts/' + ScriptToLoad + '.json', 'r') as LoadsJson: data = json.load(LoadsJson) time.sleep(.5) print('') print('Your Configure Stats:', data['Stats']) if data['MouseOption'] != MouseMode.get(): data['MouseOption'] = MouseMode.get() with open('Scripts/' + 'Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) pyautogui.PAUSE = 0.005 if data['Stats']: print("\nOpening TibiaAuto...") self.ChooseConfig.destroyWindow() time.sleep(0.1) root(CharName, ScriptToLoad) else: os.remove('Scripts/' + 'Scripts/' + ScriptToLoad + '.json') CreateDefaultJson() else: print('Coping Default Json') start_configuration = time.time() Directory = os.getcwd() shutil.copyfile(Directory + '\\Scripts' + '\\Json.json', os.path.join(Directory + '\\Scripts' + '\\' + NameCreateJson.get() + '.json')) TibiaAuto = pygetwindow.getWindowsWithTitle("Choose You Config")[0] TibiaAuto.minimize() pyautogui.PAUSE = 0.005 time.sleep(.8) with open('Scripts/' + ScriptToLoad + '.json', 'r') as LoadsJson: data = json.load(LoadsJson) time.sleep(.5) time.sleep(.5) if HookMode.get() == 1: print("Hooking OBS") else: print("Grabing Screen") try: HealthLocation[0], HealthLocation[1] = GetHealthPosition(HookMode.get()) HealthLocation[0], HealthLocation[1] = int(HealthLocation[0]), int(HealthLocation[1]) print('') print(f"Health Location [X: {HealthLocation[0]} Y: {HealthLocation[1]}]") data['Positions']['LifePosition'][0]['x'] = HealthLocation[0] data['Positions']['LifePosition'][0]['y'] = HealthLocation[1] data['Positions']['LifePosition'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) except Errno: print('Helth Position Error') data['Positions']['LifePosition'][0]['Stats'] = False with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) try: ManaLocation[0], ManaLocation[1] = GetManaPosition(HookMode.get()) ManaLocation[0], ManaLocation[1] = int(ManaLocation[0]), int(ManaLocation[1]) print('') print(f"Mana Location [X: {ManaLocation[0]} Y: {ManaLocation[1]}]") print('') data['Positions']['ManaPosition'][0]['x'] = ManaLocation[0] data['Positions']['ManaPosition'][0]['y'] = ManaLocation[1] data['Positions']['ManaPosition'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) except Errno: print('Mana Position Error') data['Positions']['ManaPosition'][0]['Stats'] = False with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) try: BattlePositions[0], BattlePositions[1], BattlePositions[2], BattlePositions[3] = GetBattlePosition(HookMode.get()) print(f"Battle Location [X: {BattlePositions[0]} Y: {BattlePositions[1]}]") data['Positions']['BattlePosition'][0]['x'] = BattlePositions[0] data['Positions']['BattlePosition'][0]['y'] = BattlePositions[1] data['Positions']['BattlePosition'][0]['Stats'] = True time.sleep(.4) data['Boxes']['BattleBox'][0]['x'] = int(BattlePositions[0]) data['Boxes']['BattleBox'][0]['y'] = int(BattlePositions[1]) data['Boxes']['BattleBox'][0]['w'] = int(BattlePositions[2]) data['Boxes']['BattleBox'][0]['h'] = int(BattlePositions[3]) data['Boxes']['BattleBox'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) except Errno: print('Battle Position Error') data['Positions']['BattlePosition'][0]['Stats'] = False with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) try: StatsPositions[0], StatsPositions[1], StatsPositions[2], StatsPositions[3] = GetStatsPosition(HookMode.get()) print('') print(f"Status Bar Start [X: {StatsPositions[0]}, Y: {StatsPositions[1]}]") print(f"Status Bar End [X: {StatsPositions[2]}, Y: {StatsPositions[3]}]") print('') time.sleep(.2) data['Boxes']['StatusBarBox'][0]['x'] = int(StatsPositions[0]) data['Boxes']['StatusBarBox'][0]['y'] = int(StatsPositions[1]) data['Boxes']['StatusBarBox'][0]['w'] = int(StatsPositions[2]) data['Boxes']['StatusBarBox'][0]['h'] = int(StatsPositions[3]) data['Boxes']['StatusBarBox'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) except Errno: print('Status Bar Error') data['Boxes']['StatusBarBox'][0]['Stats'] = False with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) try: RingPositions[0], RingPositions[1] = StatsPositions[0], StatsPositions[1] - 58 RingPositions[2] = RingPositions[0] + ItemsSquare - 1 RingPositions[3] = RingPositions[1] + ItemsSquare - 1 print(f"Ring's Square Start [X: {RingPositions[0]}, Y: {RingPositions[1]}]") print(f"Ring's Square End [X: {RingPositions[2]}, Y: {RingPositions[3]}]") print('') time.sleep(.2) data['Boxes']['RingBox'][0]['x'] = int(RingPositions[0]) data['Boxes']['RingBox'][0]['y'] = int(RingPositions[1]) data['Boxes']['RingBox'][0]['w'] = int(RingPositions[2]) data['Boxes']['RingBox'][0]['h'] = int(RingPositions[3]) data['Boxes']['RingBox'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) except Errno: print('RingPosition Error') data['Boxes']['RingBox'][0]['Stats'] = False with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) try: AmuletPositions[0], AmuletPositions[1] = StatsPositions[0], StatsPositions[1] - 130 AmuletPositions[2] = AmuletPositions[0] + ItemsSquare - 1 AmuletPositions[3] = AmuletPositions[1] + ItemsSquare - 1 print(f"Amulet's Square Start [X: {AmuletPositions[0]}, Y: {AmuletPositions[1]}]") print(f"Amulet's Square End [X: {AmuletPositions[2]}, Y: {AmuletPositions[3]}]") print('') time.sleep(.2) data['Boxes']['AmuletBox'][0]['x'] = int(AmuletPositions[0]) data['Boxes']['AmuletBox'][0]['y'] = int(AmuletPositions[1]) data['Boxes']['AmuletBox'][0]['w'] = int(AmuletPositions[2]) data['Boxes']['AmuletBox'][0]['h'] = int(AmuletPositions[3]) data['Boxes']['AmuletBox'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) except Errno: print('AmuletPosition Error') data['Boxes']['AmuletBox'][0]['Stats'] = False with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) try: MapPositions[0], MapPositions[1], MapPositions[2], MapPositions[3] = GetMapPosition(HookMode.get()) time.sleep(.2) data['Boxes']['MapBox'][0]['x'] = int(MapPositions[0]) data['Boxes']['MapBox'][0]['y'] = int(MapPositions[1]) data['Boxes']['MapBox'][0]['w'] = int(MapPositions[2]) data['Boxes']['MapBox'][0]['h'] = int(MapPositions[3]) data['Boxes']['MapBox'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) except Errno: print('MapPosition Error') data['Boxes']['MapBox'][0]['Stats'] = False with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) try: Player[0], Player[1], gameWindow[0], gameWindow[1], gameWindow[2], gameWindow[ 3] = GetPlayerPosition(HookMode.get()) print('') print(f"Player Position [X: {Player[0]}, Y: {Player[1]}]") print('') print(f"Game Window Start [X: {gameWindow[0]}, Y: {gameWindow[1]}]") print(f"Game Window End [X: {gameWindow[2]}, Y: {gameWindow[3]}]") print('') time.sleep(.2) data['Positions']['PlayerPosition'][0]['x'] = Player[0] data['Positions']['PlayerPosition'][0]['y'] = Player[1] data['Positions']['PlayerPosition'][0]['Stats'] = True data['Boxes']['GameWindowBox'][0]['x'] = int(gameWindow[0]) data['Boxes']['GameWindowBox'][0]['y'] = int(gameWindow[1]) data['Boxes']['GameWindowBox'][0]['w'] = int(gameWindow[2]) data['Boxes']['GameWindowBox'][0]['h'] = int(gameWindow[3]) data['Boxes']['GameWindowBox'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) except Errno: print('Player Position Error') data['Positions']['PlayerPosition'][0]['Stats'] = False data['Boxes']['GameWindowBox'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) try: SQMs[0], SQMs[1], SQMs[2], SQMs[3], SQMs[4], SQMs[5], SQMs[6], SQMs[7], SQMs[8], SQMs[9], SQMs[10], SQMs[ 11], SQMs[12], SQMs[13], SQMs[14], SQMs[15], SQMs[16], SQMs[17] = SetSQMs(HookMode.get()) time.sleep(0.1) print(f"1° SQM Location [X: {SQMs[0]}, Y: {SQMs[1]}]") print(f"2° SQM Location [X: {SQMs[2]}, Y: {SQMs[3]}]") print(f"3° SQM Location [X: {SQMs[4]}, Y: {SQMs[5]}]") print(f"4° SQM Location [X: {SQMs[6]}, Y: {SQMs[7]}]") print(f"5° SQM Location [X: {SQMs[8]}, Y: {SQMs[9]}]") print(f"6° SQM Location [X: {SQMs[10]}, Y: {SQMs[11]}]") print(f"7° SQM Location [X: {SQMs[12]}, Y: {SQMs[13]}]") print(f"8° SQM Location [X: {SQMs[14]}, Y: {SQMs[15]}]") print(f"9° SQM Location [X: {SQMs[16]}, Y: {SQMs[17]}]") time.sleep(.4) data['SQM']['SQM1'][0]['x'] = int(SQMs[0]) data['SQM']['SQM1'][0]['y'] = int(SQMs[1]) data['SQM']['SQM1'][0]['Stats'] = True data['SQM']['SQM2'][0]['x'] = int(SQMs[2]) data['SQM']['SQM2'][0]['y'] = int(SQMs[3]) data['SQM']['SQM2'][0]['Stats'] = True data['SQM']['SQM3'][0]['x'] = int(SQMs[4]) data['SQM']['SQM3'][0]['y'] = int(SQMs[5]) data['SQM']['SQM3'][0]['Stats'] = True data['SQM']['SQM4'][0]['x'] = int(SQMs[6]) data['SQM']['SQM4'][0]['y'] = int(SQMs[7]) data['SQM']['SQM4'][0]['Stats'] = True data['SQM']['SQM5'][0]['x'] = int(SQMs[8]) data['SQM']['SQM5'][0]['y'] = int(SQMs[9]) data['SQM']['SQM5'][0]['Stats'] = True data['SQM']['SQM6'][0]['x'] = int(SQMs[10]) data['SQM']['SQM6'][0]['y'] = int(SQMs[11]) data['SQM']['SQM6'][0]['Stats'] = True data['SQM']['SQM7'][0]['x'] = int(SQMs[12]) data['SQM']['SQM7'][0]['y'] = int(SQMs[13]) data['SQM']['SQM7'][0]['Stats'] = True data['SQM']['SQM8'][0]['x'] = int(SQMs[14]) data['SQM']['SQM8'][0]['y'] = int(SQMs[15]) data['SQM']['SQM8'][0]['Stats'] = True data['SQM']['SQM9'][0]['x'] = int(SQMs[16]) data['SQM']['SQM9'][0]['y'] = int(SQMs[17]) data['SQM']['SQM9'][0]['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) except Errno: print('SQMs Error') data['SQM']['SQM1'][0]['Stats'] = False data['SQM']['SQM2'][0]['Stats'] = False data['SQM']['SQM3'][0]['Stats'] = False data['SQM']['SQM4'][0]['Stats'] = False data['SQM']['SQM5'][0]['Stats'] = False data['SQM']['SQM6'][0]['Stats'] = False data['SQM']['SQM7'][0]['Stats'] = False data['SQM']['SQM8'][0]['Stats'] = False data['SQM']['SQM9'][0]['Stats'] = False with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) data['Stats'] = True with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) data['MouseOption'] = MouseMode.get() with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) data['HookOption'] = HookMode.get() with open('Scripts/' + ScriptToLoad + '.json', 'w') as wJson: json.dump(data, wJson, indent=4) if CheckAuto.get(): with open('Scripts/Loads.json', 'r') as LoaderJson: data2 = json.load(LoaderJson) data2['Auto'] = True data2['ScriptName'] = ScriptToLoad with open('Scripts/Loads.json', 'w') as wwJson: json.dump(data2, wwJson, indent=4) end_configuration = time.time() - start_configuration print('') print(f"Your Setup Time Is: {end_configuration:.2f} Seconds") print('') print("Opening TibiaAuto...\n") time.sleep(.3) self.ChooseConfig.destroyWindow() time.sleep(.1) ScriptToLoad = NameCreateJson.get() root(CharName, ScriptToLoad) NameCreateJson = tk.StringVar() NameCreateJson.set('NewConfig') CheckAuto = tk.BooleanVar() CheckAuto.set(True) MouseMode = tk.IntVar() MouseMode.set(1) HookMode = tk.IntVar() HookMode.set(1) if os.path.isfile('Scripts/' + NameCreateJson.get() + '.json'): with open('Scripts/' + NameCreateJson.get() + '.json', 'r') as LoadsJson: data = json.load(LoadsJson) if data['Stats']: self.ChooseConfig.addButton('Load', CreateDefaultJson, [75, 23], [310, 166]) else: self.ChooseConfig.addButton('Create', CreateDefaultJson, [75, 23], [310, 166]) else: self.ChooseConfig.addButton('Create', CreateDefaultJson, [75, 23], [310, 166]) self.ChooseConfig.addEntry([165, 35], NameCreateJson, 28) self.ChooseConfig.addLabel('Name Of The Json Conf', [24, 35]) # RadioLoadAuto = self.ChooseConfig.addCheck(CheckAuto, [10, 114], 1, 'Load automatically This Script') # RadioLoadAuto.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, # 94, 48))) LabelSelectOP1 = self.ChooseConfig.addLabel('Select Your Mouse And Keyboard Option', [30, 76]) LabelSelectOP1.configure(bg=rgb((114, 94, 48)), fg='black') RadioMouseMoviment = self.ChooseConfig.addRadio('{Global} Movement Mouse On Focused Window', MouseMode, 1, [10, 95]) RadioMouseMoviment.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) RadioSenderMouse = self.ChooseConfig.addRadio("{OTServer} Send Mouse Events To Tibia's Window", MouseMode, 0, [10, 114]) RadioSenderMouse.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) LabelSelectOP2 = self.ChooseConfig.addLabel('Select Your Hook Mode', [30, 136]) LabelSelectOP2.configure(bg=rgb((114, 94, 48)), fg='black') RadioHookWindow = self.ChooseConfig.addRadio("{Global} Hook Directly OBS Screen", HookMode, 1, [10, 155]) RadioHookWindow.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) RadioGrabScreen = self.ChooseConfig.addRadio('Grab Screen', HookMode, 0, [10, 174]) RadioGrabScreen.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) self.ChooseConfig.loop()
class AutoRing: def __init__(self, root, RingPositions, HealthLocation, MOUSE_OPTION, HOOK_OPTION): self.AutoRing = GUI('AutoRing', 'Module: Auto Ring') self.AutoRing.DefaultWindow('AutoRing', [306, 397], [1.2, 2.29]) self.SendToClient = Hotkey(MOUSE_OPTION) def SetAutoRing(): global EnabledAutoRing if not EnabledAutoRing: EnabledAutoRing = True ButtonEnabled.configure(text='AutoRing: ON', relief=SUNKEN, bg=rgb((158, 46, 34))) print("AutoRing: ON") global Ring Ring = NameRing.get() Checking() CheckingButtons() time.sleep(0.03) ThreadAutoRing = threading.Thread(target=ScanAutoRing) ThreadAutoRing.start() else: EnabledAutoRing = False print('AutoRing: OFF') ButtonEnabled.configure(text='AutoRing: OFF', relief=RAISED, bg=rgb((127, 17, 8))) Checking() CheckingButtons() def ScanAutoRing(): if CheckLifeBellowThan.get(): BellowThan = LifeBellowThan.get() from Modules.AutoHeal import EnabledAutoHeal if EnabledAutoHeal: while EnabledAutoRing and EnabledAutoHeal: try: NoHasRing = ScanRing(RingPositions, HOOK_OPTION) except Exception: NoHasRing = False pass from Modules.AutoHeal import life if NoHasRing and life <= BellowThan: Execute() else: from Engine.ScanStages import ScanStages while EnabledAutoRing: try: life = ScanStages('Life From AutoRing', HOOK_OPTION).ScanStages( HealthLocation, lifeColor, lifeColorFull) except Exception: life = 100 pass if life is None: life = 0 try: NoHasRing = ScanRing(RingPositions, HOOK_OPTION) except Exception: NoHasRing = False pass if NoHasRing and life < BellowThan: Execute() else: while EnabledAutoRing: try: NoHasRing = ScanRing(RingPositions, HOOK_OPTION) except Exception: NoHasRing = False pass if NoHasRing: Execute() def Execute(): if RadioButton.get() == 0: self.SendToClient.Press(HotkeyRing.get()) print("Pressed ", HotkeyRing.get(), " To Reallocated Your Ring") time.sleep(1) elif RadioButton.get() == 1: try: X = int(TextEntryX.get()) Y = int(TextEntryY.get()) except: X = None Y = None print("Error To Get Type Of Position") time.sleep(1) if X and Y is not None: if X < WidthScreen and Y < HeightScreen: MousePosition = pyautogui.position() pyautogui.moveTo(X, Y) pyautogui.mouseDown(button='left') pyautogui.moveTo(RingPositions[0] + 16, RingPositions[1] + 16) pyautogui.mouseUp(button='left') pyautogui.moveTo(MousePosition) print("Ring Reallocated On: X =", RingPositions[0] + 16, "Y =", RingPositions[1] + 16, "From: X =", X, "Y =", Y) time.sleep(0.3) else: print("Lower Resolution Than Entered") time.sleep(1) 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) def AddNewAmulet(): print('....') def CheckClick(): Checking() def ReturnGetPosition(): global WaitingForClick WaitingForClick = True 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('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() TibiaAuto.moveTo(RootWindowX, RootWindowY) time.sleep(0.08) AutoRingWindow.maximize() AutoRingWindow.moveTo(AutoRingWindowX, AutoRingWindowY) break Invisible.UpdateWindow(X, Y) def ValidateEntryX(*args): s = TextEntryX.get() if len(s) > MaxLen: if not s[-1].isdigit(): TextEntryX.set(s[:-1]) else: TextEntryX.set(s[:MaxLen]) def ValidateEntryY(*args): s = TextEntryY.get() if len(s) > MaxLen: if not s[-1].isdigit(): TextEntryY.set(s[:-1]) else: TextEntryY.set(s[:MaxLen]) WidthScreen, HeightScreen = pyautogui.size() CheckPrint = tk.BooleanVar() LowMana = tk.BooleanVar() RadioButton = tk.IntVar() NameRing = tk.StringVar() NameRing.set('MightRing') HotkeyRing = tk.StringVar() HotkeyRing.set("Shift + F3") TextEntryX = tk.StringVar() TextEntryY = tk.StringVar() CheckLifeBellowThan = tk.BooleanVar() CheckLifeBellowThan.set(False) LifeBellowThan = tk.IntVar() LifeBellowThan.set(30) self.AutoRing.addButton('Ok', self.AutoRing.destroyWindow, [73, 21], [115, 365]) global EnabledAutoRing if not EnabledAutoRing: ButtonEnabled = self.AutoRing.addButton('AutoRing: OFF', SetAutoRing, [287, 23], [11, 336]) else: ButtonEnabled = self.AutoRing.addButton('AutoRing: ON', SetAutoRing, [287, 23], [11, 336]) ButtonEnabled.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) CheckPrint = self.AutoRing.addCheck(CheckPrint, [11, 285], 0, "Print on Tibia's screen") CheckPrint.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) CheckBuff = self.AutoRing.addCheck(LowMana, [11, 305], 0, "Don't Buff") CheckBuff.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) BackImage = 'images/Fundo.png' Back = self.AutoRing.openImage(BackImage, [150, 45]) RingImg = 'images/Rings/MightRing.png' ImageID = self.AutoRing.openImage(RingImg, [64, 64]) ImgLabel = self.AutoRing.addLabel('Image To Search', [16, 22]) self.AutoRing.addImage(ImageID, [28, 43]) RingLabel = self.AutoRing.addLabel('Select Name Of Ring', [135, 55]) OptionNameRing = self.AutoRing.addOption(NameRing, Rings, [120, 80], width=21) ButtonAddNewRing = self.AutoRing.addButton('Add New Ring', AddNewAmulet, [167, 24], [120, 115]) ButtonRecapture = self.AutoRing.addButton('Recapture', Recapture, [88, 24], [22, 115]) DescLabel = self.AutoRing.addLabel('', [150, 140]) RButton1 = self.AutoRing.addRadio('Hotkey', RadioButton, 0, [22, 155], CheckClick) RButton2 = self.AutoRing.addRadio('Position', RadioButton, 1, [22, 175], CheckClick) CheckBoxLifeBellowThan = self.AutoRing.addCheck( CheckLifeBellowThan, [60, 210], 0, 'Use Only If Life Is Bellow Than') LabelLifeBellowThan = self.AutoRing.addLabel('Life <= ', [90, 245]) PercentageLifeBellowThan = self.AutoRing.addOption( LifeBellowThan, percentage, [140, 240]) def Checking(): global FoundedImg, Ring if RadioButton.get() == 0: DescLabel.configure(text='Hotkey To Press') self.AutoRing.addImage(Back, [130, 165]) FoundedImg = False HotkeyOption = self.AutoRing.addOption( HotkeyRing, self.SendToClient.Hotkeys, [145, 170], 10) if EnabledAutoRing: HotkeyOption.configure(state='disabled') else: HotkeyOption.configure(state='normal') elif RadioButton.get() == 1: DescLabel.configure(text='Position To Search') self.AutoRing.addImage(Back, [120, 165]) FoundedImg = False ButtonGetPosition = self.AutoRing.addButton( 'GetPosition', ReturnGetPosition, [80, 29], [195, 173]) LabelX = self.AutoRing.addLabel('X:', [135, 165]) EntryX = self.AutoRing.addEntry([150, 165], TextEntryX, width=4) TextEntryX.trace("w", ValidateEntryX) LabelY = self.AutoRing.addLabel('Y:', [135, 185]) EntryY = self.AutoRing.addEntry([150, 185], TextEntryY, width=4) TextEntryY.trace("w", ValidateEntryY) if EnabledAutoRing: ButtonGetPosition.configure(state='disabled') LabelX.configure(state='disabled') EntryX.configure(state='disabled') LabelY.configure(state='disabled') EntryY.configure(state='disabled') else: ButtonGetPosition.configure(state='normal') LabelX.configure(state='normal') EntryX.configure(state='normal') LabelY.configure(state='normal') EntryY.configure(state='normal') if not CheckLifeBellowThan.get(): LabelLifeBellowThan.configure(state='disabled') PercentageLifeBellowThan.configure(state='disabled') elif CheckLifeBellowThan.get(): LabelLifeBellowThan.configure(state='normal') PercentageLifeBellowThan.configure(state='normal') def CheckingButtons(): if EnabledAutoRing: CheckPrint.configure(state='disabled') CheckBuff.configure(state='disabled') DescLabel.configure(state='disabled') ImgLabel.configure(state='disabled') ButtonRecapture.configure(state='disabled') ButtonAddNewRing.configure(state='disabled') RButton1.configure(state='disabled') RButton2.configure(state='disabled') RingLabel.configure(state='disabled') OptionNameRing.configure(state='disabled') CheckBoxLifeBellowThan.configure(state='disabled') LabelLifeBellowThan.configure(state='disabled') PercentageLifeBellowThan.configure(state='disabled') else: CheckPrint.configure(state='normal') CheckBuff.configure(state='normal') DescLabel.configure(state='normal') ImgLabel.configure(state='normal') ButtonRecapture.configure(state='normal') ButtonAddNewRing.configure(state='normal') RButton1.configure(state='normal') RButton2.configure(state='normal') RingLabel.configure(state='normal') OptionNameRing.configure(state='normal') CheckBoxLifeBellowThan.configure(state='normal') if not CheckLifeBellowThan.get(): LabelLifeBellowThan.configure(state='disabled') PercentageLifeBellowThan.configure(state='disabled') elif CheckLifeBellowThan.get(): LabelLifeBellowThan.configure(state='normal') PercentageLifeBellowThan.configure(state='normal') def ConstantVerify(): if not EnabledAutoRing: if not CheckLifeBellowThan.get(): LabelLifeBellowThan.configure(state='disabled') PercentageLifeBellowThan.configure(state='disabled') elif CheckLifeBellowThan.get(): LabelLifeBellowThan.configure(state='normal') PercentageLifeBellowThan.configure(state='normal') self.AutoRing.After(1, ConstantVerify) Checking() CheckingButtons() ConstantVerify() self.AutoRing.loop()
class AutoMana: def __init__(self, root, ManaLocation, MOUSE_OPTION, HOOK_OPTION): self.AutoMana = GUI('AutoMana', 'Module: Auto Mana') self.AutoMana.DefaultWindow('AutoMana', [306, 272], [1.2, 2.29]) self.SendToClient = Hotkey(MOUSE_OPTION) self.Scan = ScanStages('Mana', HOOK_OPTION) def SetAutoMana(): global EnabledAutoMana if not EnabledAutoMana: EnabledAutoMana = True ButtonEnabled.configure(text='AutoMana: ON', relief=SUNKEN, bg=rgb((158, 46, 34))) print("AutoMana: ON") CheckingButtons() try: ThreadAutoMana = threading.Thread(target=ScanAutoMana) ThreadAutoMana.start() except: print("Error: Unable To Start ThreadAutoMana!") else: EnabledAutoMana = False print("AutoMana: OFF") CheckingButtons() ButtonEnabled.configure(text='AutoMana: OFF', relief=RAISED, bg=rgb((127, 17, 8))) def ScanAutoMana(): while EnabledAutoMana: try: mana = self.Scan.ScanStages(ManaLocation, manaColor, manaColorFull) except Exception: mana = 100 pass if mana is None: mana = 0 if VarCheckStageTwo.get(): stage_two = VarPercentageStageTwo.get() if stage_two > mana or stage_two == mana: self.SendToClient.Press(VarHotkeyStageTwo.get()) print("Pressed ", VarHotkeyStageTwo.get()) time.sleep(.1) elif VarCheckStageOne.get(): stage_one = VarPercentageStageOne.get() if stage_one > mana or stage_one == mana: self.SendToClient.Press(VarHotkeyStageOne.get()) print("Pressed ", VarHotkeyStageOne.get()) time.sleep(.1) else: print("Modulo Not Configured") time.sleep(1) VarCheckPrint = tk.BooleanVar() VarCheckBuff = tk.BooleanVar() VarCheckStageOne = tk.BooleanVar() VarCheckStageTwo = tk.BooleanVar() VarPercentageStageOne = tk.IntVar() VarPercentageStageOne.set(60) VarHotkeyStageOne = tk.StringVar() VarHotkeyStageOne.set("F3") VarPercentageStageTwo = tk.IntVar() VarPercentageStageTwo.set(45) VarHotkeyStageTwo = tk.StringVar() VarHotkeyStageTwo.set("F4") self.AutoMana.addButton('Ok', self.AutoMana.destroyWindow, [73, 21], [115, 240]) ''' button enable healing ''' global EnabledAutoMana if not EnabledAutoMana: ButtonEnabled = self.AutoMana.addButton('AutoMana: OFF', SetAutoMana, [287, 23], [11, 211]) else: ButtonEnabled = self.AutoMana.addButton('AutoMana: ON', SetAutoMana, [287, 23], [11, 211]) ButtonEnabled.configure(relief=SUNKEN, bg=rgb((158, 46, 34))) LabelPercentage = self.AutoMana.addLabel('% Percentage', [145, 24]) LabelHotkey = self.AutoMana.addLabel('HotKey', [230, 24]) CheckPrint = self.AutoMana.addCheck(VarCheckPrint, [11, 160], 0, "Print on Tibia's screen") CheckPrint.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) CheckBuff = self.AutoMana.addCheck(VarCheckBuff, [11, 180], 0, "Don't Buff") CheckBuff.configure(bg=rgb((114, 94, 48)), activebackground=rgb((114, 94, 48)), selectcolor=rgb((114, 94, 48))) StageOne = self.AutoMana.addCheck(VarCheckStageOne, [17, 55], 0, "Enable Stage One") StageTwo = self.AutoMana.addCheck(VarCheckStageTwo, [17, 105], 0, "Enable Stage Two") PercentageStageOne = self.AutoMana.addOption(VarPercentageStageOne, percentage, [148, 54]) HotkeyStageOne = self.AutoMana.addOption(VarHotkeyStageOne, self.SendToClient.Hotkeys, [223, 54]) PercentageStageTwo = self.AutoMana.addOption(VarPercentageStageTwo, percentage, [148, 104]) HotkeyStageTwo = self.AutoMana.addOption(VarHotkeyStageTwo, self.SendToClient.Hotkeys, [223, 104]) def CheckingButtons(): if EnabledAutoMana: CheckPrint.configure(state='disabled') CheckBuff.configure(state='disabled') StageOne.configure(state='disabled') StageTwo.configure(state='disabled') PercentageStageOne.configure(state='disabled') HotkeyStageOne.configure(state='disabled') PercentageStageTwo.configure(state='disabled') HotkeyStageTwo.configure(state='disabled') LabelPercentage.configure(state='disabled') LabelHotkey.configure(state='disabled') else: CheckPrint.configure(state='normal') CheckBuff.configure(state='normal') StageOne.configure(state='normal') StageTwo.configure(state='normal') PercentageStageOne.configure(state='normal') HotkeyStageOne.configure(state='normal') PercentageStageTwo.configure(state='normal') HotkeyStageTwo.configure(state='normal') LabelPercentage.configure(state='normal') LabelHotkey.configure(state='normal') CheckingButtons() self.AutoMana.loop()