Help clash of clones

I need help with this level I have tried everything

here is my code

hero.moveXY(38, 92)
while True:
enemy = hero.findNearestEnemy()
hero.cleave(enemy)
hero.attack(enemy)
hero.moveXY(30, 31)
hero.shield()

1 Like

Welcome to the forum! This is a family-friendly place where coders can share bugs, ask for help on any CodeCombat level (don’t forget to post your code correctly 1), or just hang out with other coders. But before you proceed, please check out our guidelines: this topic.

Have a great time! :partying_face:

1 Like

Thanks I have been working at this level for a year now and have gone through lots of variations of the code and i just cant beat the level

hero.moveXY(38, 92)
while True:
enemy = hero.findNearestEnemy()
hero.cleave(enemy)
hero.attack(enemy)
hero.moveXY(30, 31)
hero.shield()

Firstly, you might be attacking yaks. Secondly, your hero will try to cleave even if he is not ready, making the hero wait. Instead, try this:

hero.moveXY(38, 92)
while True:
enemy = hero.findNearestEnemy()
if enemy and hero.isReady("cleave") and enemy.type != "sand-yak":
    hero.cleave(enemy)
else:
    if enemy and enemy.type != "sand-yak":
        hero.attack(enemy)
        hero.shield()
hero.moveXY(30, 31)

Note, you might have to add more code.

I beat it with


I won’t show you the code, but it has something to do with tanking damage (also, ignore the boss star since it’s from mountain and glacier and I didn’t use it in this level)

Thats what I had when I beat it too, but with the Rune-sword, emperors glove, and fine leather boots. (and not boss star)

Try equiping what i have circled.

e3f1f0d86e3f84709ca39c4f1664ed78b500acfa.jpeg

i cant see the image

Equip the
Boots of Jumping
Sapphire Sense Stone
Twilight Glasses
Boss Star IV
Emperors Gloves
Ezeroths Timepiece

That’s what I used to beat the level

also, level link again, please, i cannot find the level

nevermind, i found it bui beat the level using Javascript, that was my most recent go through.

I am doing this in python
https://codecombat.com/play/level/clash-of-clones?

I lost my correct code when i started it in javascript. But @MarmiteOnToast or @Anonym would be some other people who could help you.

2 Likes

I’d love to help but I solved this level with good gear yet again :confused:

1 Like

Yeah… I used a wizard so I can’t really help either…

Maybe @Aya could help.

1 Like

Im gonna look into it a while later.

For now can you post your current code

There’s the current code

get read gloves, use runesword, remove sheild code and most important make sure you are not attacking
sand yaks and one more tip use gordan

use ned and run into the enemy’s archer line then cleave start heart shielding and shielding to draw attention but taking very little damage once you can cleave again and start attacking and bashing and cleaving. but if you run low on health run back to your archers and let your soldiers fight for you.