HELP Clash of clones!

Cant solve this level, need help :frowning:

while True:
enemy = hero.findNearestEnemy()
if hero.distanceTo(enemy) < 10:
hero.attack(enemy)
else:
hero.say(“Come!”)
if enemy.health > 300:
hero.shield()
else:
hero.attack(enemy)

Hi Ry4n_17,

In order to help, we need to see your code in proper format. For example, Python, if you happen to be using it, will throw an error if you do not have your indentation correct. As you may notice, what you wrote (actually, copied and pasted) shows no indentation.

You can learn how to post correctly here:

Hi. I would also like to add that there’s only so much we can help you with this level. There’s no right answer, although there are a few tactics which work really well.
First of all, do what bobby says then, make sure your code doesn’t have any errors.
A large part of this level is your equipment, the one advantage you have over the clone is that you can use abilities. So find as many items you can which have abilities (I can think of five I could have on at the same time).
If that still doesn’t work, try killing the archers first, because they do the most damage.
I hope this helps
-Danny
P.S please could you only post posts looking for help in one location, otherwise it clutters up the forum unnecessarily and uses more peoples time.

what is your equipment?

There are a TON of threads on this board regarding this level. Spend some time reading about what others did and it will help you develop your own strategy.

https://discourse.codecombat.com/search?q=clash%20of%20clones

Just think of items which you might say…
if hero.isReady("example-ability") or if hero.canCast("example-spell")
You have definitely used some of those already.
-Danny

ok thx
(20 kinds of equipment)

but i mean like what kind of armor

It doesn’t matter what your amour is really, because your clone’s is the same as yours.
Although, saying that, I would still use your best armour.
-Danny

Here’s a sneaky trick I did:
Put on very bad gear and weapons, just enough to survive a few arrows.
Equip pet wolf to help you catch arrows.
Move/jump up and down the whole level.
Let your army do the job.
That way, your clone will be eliminated quickly and your army will overpower Thoktar’s army.

try not to make the hero say anything.

this is my code
while True:
enemy = hero.findNearestEnemy()
if enemy and enemy.type != “sand-yak”:
hero.attack(enemy)
if hero.isReady(“shockwave”):
hero.cast(“shockwave”, enemy)

Hi, @hello_there, welcome to the CodeCombat Discourse.
Are you having problems with this level?
Danny

no but i wanted to share my code

1 Like

hi if anyone needs help: Hint: attack enemy archers

This is a very easy level. Cast invisability and earthquake the archers.

hero.cast("invisibility", hero)
hero.moveXY(#archer.pos.x, archer.pos.y)
hero.cast("reset-cooldown", "invisibility")
hero.cast("earthquake", x, y) # chain-lightning works too 
# although earthquake is stronger
# Then do the rest by yourself

Earthquake isn’t currently a spell, what are you referring to?
Danny

i think @EpicCoder999 has level 66 items and there is earthquake spell in one of the items