Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Clash Of Clones Help appreciated

while True:
    clone = hero.findByType("clone", hero.findEnemies())
    enemy = hero.findNearestEnemy()
    if enemy.type != "sand-yak":
        if hero.isReady("cleave"):
            hero.cleave(enemy)
        else:
            hero.attack(enemy)

I don’t think I understand what you are saying

Nope. “Clone” won’t help. What hero do you play?

I am currently playing as Anya

So, I’m trying to say that

so replace “clone” with “captain”?

Yep. This is one of the way to specify him.

ok thank you! I will remake my code to properly include it.

1 Like
while True:
    captain = hero.findByType("captain", hero.findEnemies())
    enemy = hero.findNearestEnemy()
    if enemy.type != "sand-yak":
        if enemy == captain:
            hero.attack(captain)
        if hero.isReady("cleave"):
            hero.cleave(enemy)
        else:
            hero.attack(enemy)

so this is my code right now. I’m clearly doing something wrong but I don’t know what. My hero still doesn’t target the clone first.

You define captain already, so if you want to attack him first, you may simply do something like:

captain = hero.findByType("captain", hero.findEnemies())
if captain:
    hero.attack(captain)

I think, it should solve the task of attacking clone firs, but I suppose, won’t help to complete the level.

while True:
    enemy = hero.findNearestEnemy()
    captain = hero.findByType("captain", hero.findEnemies())
if captain:
    hero.bash(captain)
    hero.attack(captain)
    if enemy.type != "sand-yak":
        hero.attack(enemy)
        hero.shield()
        hero.bash(enemy)
        hero.attack(enemy)

this is my current code. My hero still doesn’t attack the clone first or attack at all.

If you want i can send a screenshot of my gear

OK, let’s see what we can see))

Too weak, I think. How much HP does your hero have with this stuff?

Too strong :wink:
4 lines of code, same armour, no bash, only shield.

I take off my hat to you))

Does it work with Tharin/Anya though?

He/she has about 1500 health. Can be done with any hero if shiled() available. In fact only 3 lines of code with moveXY, but I always use move.

Gosh!) Sometimes the most simple way is the best one) It’s funny I didn’t thought about shield() in spite of being annoyed many times by shielding guys on multplayer arena)
One more time - brilliant! And thanks)

i cant believe that worked. I had been stuck for so long. thank you.

It’s better to use chain lightning.

         victim2 
         victim1 
->->->-> victim0 

I think it’s most effective when lighting and the target row form 90 degree angle.
See hero with less health and use of emperor gloves Without Losing Friends

1 Like