Clash of Clones help


#44

Help! I’m stuck on clash of clones. I’m using the bash method and simple sword. Should I get worse armor? My code is basically find enemy if enemy if ready bash then bash else attack. My shield is steel shield.


#45

please reply!!!


#46

Strategy and code is what matters here, not equipment. Use as little armor as possible so that your clone is easy to kill. Then use special powers, not just attack, for your hero. I used Tharin and chain lightening. Then just stand back and let the soldiers and archers do what they do best. Don’t attack sand yaks.
if enemy and enemy.type != "sand yak":


#47

I don’t have enough for chain lightning what else to you advise


#48

while True:

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("bash"):
                hero.bash(enemy)
            else:
                self.attack(enemy)
if self.health <= self.maxHealth / 4:
    enemy = enemies[enemyIndex]
    distance = self.distanceTo(enemy)
    enemyIndex += 1
    if distance > 2:
        if enemy.type != 'sand-yak':
            if self.isReady("cleave"):
                hero.cleave(enemy)
            else:
                hero.attack(enemy)

This is my code. Can you please help


#49

never mind i passed awesome


#50

What did you use for equipment?


#51

runesword, painted steel helmet, tarnished bronze breastplate, engraved wristwatch, worker’s gloves, wooden strand, thornprick, crude telephoto glasses, leather boots, programation iii, basic flags.


#52

here is my code i have been stuck for ages please help!
while True:
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(“electrocute”):
hero.electrocute(enemy)
if self.isReady(“bash”):
hero.bash(enemy)
if self.isReady(“cleave”):
hero.cleave(enemy)
else:
self.attack(enemy)
if self.health <= self.maxHealth / 4:
enemy = enemies[enemyIndex]
enemy=hero.findNearestEnemy()
distance=hero.distanceTo(enemy)
enemyIndex += 1
while enemy.health>0 :

        if distance < 4:
            if self.isReady("cleave"):
                self.cleave(enemy)
            else:
                self.attack(enemy)
        else:
            self.attack(enemy)

#53

@starwars72015

Please learn to post ALL of your code properly. It’s really easy and only requires a very small amount of effort.

To post your code from the game, use the </> button or it won’t format properly. When you click the </> button, the following will appear:

Please paste ALL of your code inside the triple back tick marks.

``` <— Triple back tick marks.

Paste ALL of your code in here.

``` <— Triple back tick marks.

There are many people here willing and able to help. If you use the </> button correctly, then ALL of your code should look like this:

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
    else:
        hero.say("My code is formatted properly")

If ALL of your code isn’t formatted like the code above, then you’re doing it wrong and we can’t see the structure of the code to troubleshoot whether or not that is the issue. Use the </> button and help us help you. This works when sending a private message as well.

Thank you.


#54

Yes thank you @MunkeyShynes for that legit canned post that I’ve probably seen like a billion times.


#55

here is my code

while True:
    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("electrocute"):
                    hero.electrocute(enemy)
                if self.isReady("bash"):
                    hero.bash(enemy)
                if self.isReady("cleave"):
                    hero.cleave(enemy)
                if self.isReady("power up"):
                    self.powerUp()
                else: 
                    self.attack(enemy)
    if self.health <= self.maxHealth / 4:
        enemy = enemies[enemyIndex]
        enemy=hero.findNearestEnemy()
        distance=hero.distanceTo(enemy)
        enemyIndex += 1
        while enemy.health>0 :
            if distance < 4:
                if self.isReady("cleave"):
                    self.cleave(enemy)
                else:
                    self.attack(enemy)
            else:
                self.attack(enemy)