示例#1
0
 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")
示例#2
0
 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")
示例#3
0
 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
示例#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
示例#5
0
 def BuildMill():
     Hotkeys.SendHotKeys("Build Mill")
     AoE3Env.build()
     return 30  # elapse time tu build [s]
示例#6
0
 def TrainVillager():
     Hotkeys.SendHotKeys("Find Town Center")
     Hotkeys.SendHotKeys("Train Villager")
     return 1
示例#7
0
 def BuildTownCenter():
     Hotkeys.SendHotKeys("Find Wagon")
     Hotkeys.SendHotKeys("Build Town Center")
     AoE3Env.build()
     return 30
示例#8
0
 def Improve(self):
     Hotkeys.SendHotKeys("Find Mill")
     self.gameEnv.InGameGui["OptionSlot0"].click()
示例#9
0
 def BuyGoldWithWood(self):
     Hotkeys.SendHotKeys("Find Market")
     self.gameEnv.InGameGui["OptionSlot13"].click()
示例#10
0
 def on_hotkey(self):
     import Hotkeys
     director.push(SlideInTTransition(Hotkeys.get_hotkeys()))
示例#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
示例#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
示例#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
示例#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