Clash of Clones, Javascript


This is my code

while (true) {
    var enemy = hero.findNearestEnemy();
    if (enemy && > 0) {
        if ( < / 4) {
        } else if (hero.isReady) {

My hero will keep bashing until it died


“else if (hero.isReady)” to do what?

// You'll need good strategy to win this one!
// Your clone will have the same equipment you have!
// But, they're not very skilled at using special powers.
while (true) {
    while ( > / 4) {
        var enemy = hero.findNearestEnemy();
        if (enemy && > 0) {
            if (enemy && hero.isReady("cleave")) {
            } else if(hero.isReady("bash")){
            else {

How do I let my hero run away after it’s health is lower then 100



if < 100 {

That code wouldn’t let u beat the clone tho.

I suggest buying emperor’s gloves, go behind the enemy’s archers and chain-lightning them. Then let your archers and soldiers do the rest.


I don’t have any gems to buy them, how do I get them @SuperSmacker?


Do more replayable levels, do some previous levels that u didn’t finish, or jump ahead to the mountains (kind of cheating but u can use name here) to access any level. :stuck_out_tongue: This also allows you to bypass the “Restricted Equipment” check.


Thanks! What are replayable levels?


Dungeon Brawl, Backwoods Brawl, Backwoods Treasure, Sarven Brawl, Sarven Treasure, Sarven Siege, and more. You can play them over and over again. Each time you beat the level, you get more gems and exp but the level gets harder.


Levels like sarven brawls


Any way I can pass the level without buying those gloves?

This is my inventory:



About gems see this How to get GEMS, Stuck in Sarven Desert
the while loop you have is some kind of while True loop
If you have 800 health -> 800>200 then 400>100 then… you die

 while ( > / 4)

replace with > hero.maxHealth / 4:


@xython good catch didn’t see that


You can pass every level with this equipment:

/ I never use flags/


My Mac can see it. :wink:


Oh wait nevermind I can see it now. Internet lag b4. Wasn’t loading.


I dont have any pets…


@BrendGroen that’s needed for like Arrowproof Wolf level and stuff. Not needed for clash of clones.

@xython btw sometimes griffin pet or pugicorn is needed instead of the wolf pet