Clash of Clones Help - Sarven Desert

Maybe check if theres an enemy again when you do bash.

I tried but I got the same result.Code:

while (true) {
    var enemy = hero.findNearestEnemy();
        if (enemy) {
            hero.attack(enemy);
            
            if (hero.isReady("cleave")) {
                hero.cleave(enemy);
            }
            
            if (enemy && hero.isReady("bash")) {
                hero.bash(enemy);
            }
        }
    }

Or, use elif instead. With three stacked if statements, each one will fire in sequence. Using elif, only the first ‘true’ branch will fire…one firing per iteration.

1 Like

You could run away using flags when you’re low on health and let your troops to all the work.

I’m not sure if I did it correctly, but my code didn’t work

while (true) {
    var enemy = hero.findNearestEnemy();
            
            if (hero.isReady("cleave")) {
                hero.cleave(enemy);
                
            } else {
                hero.attack(enemy);
                hero.shield();
            }
            
            if (enemy && hero.isReady("bash")) {
                hero.bash(enemy);
            }
        }

After I run away, what do I do? My clone keeps following me.

Try to make them attack the yaks using flags.

YEET :smiley: When I put the if bash is ready statement at the top, I won!

Thank you for your help, dedreous, Danny, and AnseDra! :slight_smile:

1 Like

Glad I could help! :wink:

1 Like

I’m on the next level now. I know what I’m about to ask you isn’t on topic, and sorry for that. In Crag Tag (Cloudrip Mountain) what boots do I need? The arrow points to a pair that is restricted in the level.

Boots of Leaping…new topic for any more though, please :wink:

1 Like

Ok, thanks! I hope I have enough gems for that lol

Or any boots that have the move() method

1 Like