2. StarCraft II Python Bot: Building units

Everything is an unit.Random Apex Base Script import sc2 from sc2 import run_game, maps, Race, Difficulty from sc2.player import Bot, Computer from sc2.ids.unit_typeid import * class AlanBot(sc2.BotAI): async def on_step(self, iteration): await self.buildWorkers() await self.distribute_workers() await self.buildRefineries() async def buildWorkers(self): for commandcenter in self.units(UnitTypeId.COMMANDCENTER).ready.noqueue: if self.can_afford(UnitTypeId.SCV) and self.workers.amount < self.units(UnitTypeId.COMMANDCENTER).amount * 14 + 4: await … Sigue leyendo 2. StarCraft II Python Bot: Building units