Esempio n. 1
0
    def respawn(self, shard, room, position):
        if not self.shouldSpawn():
            return False

        statusres = screepsclient.world_status()
        if 'status' in statusres and statusres['status'] == 'lost':
            screepsclient.respawn()
            click.echo('Sleeping to avoid respawn rate limiting')
            sleep(185)

        self.resetMemory()

        ret = screepsclient.place_spawn(room, 'Spawn1', position['x'], position['y'], shard)
        if 'error' in ret:
            click.echo(ret['error'])
            return False
        return True
Esempio n. 2
0
 def shouldSpawn(self):
     statusres = screepsclient.world_status()
     return 'status' in statusres and statusres['status'] == 'empty'
 def shouldSpawn(self):
     statusres = screepsclient.world_status()
     return 'status' in statusres and statusres[
         'status'] in UNSPAWNED_STATUSES