Clash of Clones


#1

My hero would survive and then went to attack the sand yaks and had little health and was killed by the sand yak now he doesn’t survive the enemy. Please help.

loop:
    enemyIndex = 0
    enemies = self.findEnemies()
    while enemyIndex < len(enemies) and self.health > self.maxHealth / 4:
        enemy = enemies[enemyIndex]
        enemyIndex += 1
        if enemy.type != 'sand-yak':
          while enemy.health > 0:
            if self.isReady("cleave"):
                    self.cleave(enemy)
             else: 
                 self.attack(enemy)
    if self.health <= self.maxHealth / 4:
        enemy = enemies[enemyIndex]
        distance = self.distanceTo(enemy)
        enemyIndex += 1
        if distance > 2:
           if self.isReady("cleave"):
                                 self.cleave(enemy)
            else:
                self.attack(enemy)

#2

Try to use MoveXY to the center first, so var enemy = this.findNearest(this.findEnemies()); would find that the clones as the closest target rather than the yaks.


#3

im using python not java


#4

Then like this: enemy = self.findNearest(this.findEnemies())


#5

i am not using this.