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
Exemple #4
0
    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()
Exemple #10
0
 def on_hotkey(self):
     import Hotkeys
     director.push(SlideInTTransition(Hotkeys.get_hotkeys()))
Exemple #11
0
 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
Exemple #12
0
 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
Exemple #13
0
 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
Exemple #14
0
 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