def WorkOnMill(): Hotkeys.SendHotKeys("Find idle Villager") Hotkeys.SendHotKeys("Create temp Group") Hotkeys.SendHotKeys("Find Mill") Hotkeys.SendHotKeys("Select temp Group") AoE3Env.PerformCrossSearch(["GameMessages/Mill_Food_building.PNG"], func=pyautogui.rightClick) pyautogui.hotkey("esc")
def WorkOnSilverMine(self): Hotkeys.SendHotKeys("Find idle Villager") Hotkeys.SendHotKeys("Create temp Group") self.gameEnv.findSilverMine() Hotkeys.SendHotKeys("Select temp Group") AoE3Env.PerformCrossSearch( ["GameMessages/Silver_Mine_Coin_source.PNG"], func=pyautogui.rightClick) pyautogui.hotkey("esc")
def ImproveAge(self) -> bool: Hotkeys.SendHotKeys("Find Town Center") self.gameEnv.InGameGui["OptionSlot6"].click() acceptButtonPosition = GUIParser.locate("Buttons/Accept.png", center=True) if acceptButtonPosition is not None: self.gameEnv.InGameGui.click(*acceptButtonPosition) Hotkeys.SendHotKeys("Deselect All") return acceptButtonPosition is not None
def getDeckCard(self, CardName: str): Hotkeys.SendHotKeys("Find Home City") if CardName not in self.InGameGui.items(): try: self.InGameGui.addItem( GuiItem(f"{CardName}", None, IconPath=os.getcwd() + f"/DeckCards/{CardName}.PNG")) except TypeError: time.sleep(1) self.InGameGui.addItem( GuiItem(f"{CardName}", None, IconPath=os.getcwd() + f"/DeckCards/{CardName}.PNG")) card = self.InGameGui[CardName] card.click() pyautogui.hotkey("esc") return 60
def BuildMill(): Hotkeys.SendHotKeys("Build Mill") AoE3Env.build() return 30 # elapse time tu build [s]
def TrainVillager(): Hotkeys.SendHotKeys("Find Town Center") Hotkeys.SendHotKeys("Train Villager") return 1
def BuildTownCenter(): Hotkeys.SendHotKeys("Find Wagon") Hotkeys.SendHotKeys("Build Town Center") AoE3Env.build() return 30
def Improve(self): Hotkeys.SendHotKeys("Find Mill") self.gameEnv.InGameGui["OptionSlot0"].click()
def BuyGoldWithWood(self): Hotkeys.SendHotKeys("Find Market") self.gameEnv.InGameGui["OptionSlot13"].click()
def on_hotkey(self): import Hotkeys director.push(SlideInTTransition(Hotkeys.get_hotkeys()))
def selectTownCenter(self): from Units import Unit, TownCenter Hotkeys.SendHotKeys("Find Town Center") unitIcon = Unit.UnitIconsDirectory + self._bot.civ + "/TownCenter.png" return TownCenter(unitIcon, self) if self.InGameGui.imgIn(unitIcon) else None
def selectMill(self): from Units import Unit, Mill Hotkeys.SendHotKeys("Find Mill") unitIcon = Unit.UnitIconsDirectory + self._bot.civ + "/Mill.PNG" return Mill(unitIcon, self) if self.InGameGui.imgIn(unitIcon) else None
def selectMarket(self): from Units import Unit, Market Hotkeys.SendHotKeys("Find Market") unitIcon = Unit.UnitIconsDirectory + self._bot.civ + "/Market.PNG" return Market(unitIcon, self) if self.InGameGui.imgIn(unitIcon) else None
def selectIdleVillager(self): from Units import Unit, Villager Hotkeys.Find_idle_Villager() unitIcon = Unit.UnitIconsDirectory + self._bot.civ + "/Villager.PNG" return Villager(unitIcon, self) if self.InGameGui.imgIn(unitIcon) else None