Clash of Clones Help!

once again, I’m with @SuperSmacker.

no i didn’t but thanks for the comments sorry you might of misunderstood i did say “thanks anyway”

i dont understaand what u r saying

Hello everyone,

I’m not sure what’s up lately, but we’re all suddenly being rude to one another.

He came on here to ask for help on Clash of Clones – this topic is about asking for help on Clash of Clones. We don’t need a new Clash of Clones topic every month. It is completely ok to post on an older topic if it is relevant. As long as it’s on topic and still relevant, go ahead and post on an older topic.

“I’m stuck here too.” is perfectly acceptable.

This is not helpful at all. There’s no need for this sort of calling-out of other people. If you believe someone is causing more harm than good, report it to the moderators and we will look into it.

How/Why is it obvious he doesn’t need help? If someone is posting multiple topics about the same thing, please flag it so moderators are informed and we’ll look into it.

These are not useful. If you have nothing to say on a topic, do not post on it.

Let’s say he did copy and paste it – he’s still struggling and asking for help and you’re responding by harassing him.

Did they? I just scanned the topic again. I see several accusations, but no offers to help.

These forums are meant to be an open community for people. We have rules and those rules including being civil to one another. If you react in hostile ways (“is that even your code?”) you are harming the community. People will be less likely to ask for help.

Before you post*, think about what you’re posting. Is it likely to improve the situation? Are you helping someone find an answer?

Helpful

  • Asking them to format their code right, that makes it easier to read and review.
  • Asking them to look for existing topics about the same issue.
  • Offering hints or small snippets of code.

Not Helpful

  • accusations
  • sniping at each other with insults

Maka

  • this is also useful in all other aspects of your life. Does what you’re about to say help others or does it just make you feel superior in some way? One is selfless, the other is selfish.
4 Likes

I need help How do you beat Clash of clones? this is my code so far:

def findStrongestEnemy(enemies):
    strongest = None
    strongestHealth = 0
    enemyIndex = 0
    while enemyIndex < len(enemies):
        enemy = enemies[enemyIndex]
        if enemy.health > strongestHealth:
            strongest = enemy
            strongestHealth = enemy.health
        enemyIndex += 1
    return strongest
    
while True:
    enemies = hero.findEnemies()
    item = hero.findNearestItem()
    
    enemy = findStrongestEnemy(enemies)
    
    if enemy:
        if hero.isReady("stomp"):
                hero.stomp()
        else:
            if hero.isReady("throw") and hero.distanceTo(enemy.pos) < hero.throwRange:
                hero.throw(enemy)
            else:
                if hero.isReady("hurl"):
                    hero.hurl(enemy)
                else:
                    if hero.isReady("chain-lightning"):
                        hero.cast("chain-lightning", enemy)
                    else:
                        hero.attack(enemy)
    else:
        if hero.isReady("stomp"):
            hero.stomp()
        else:
            if hero.isReady("hurl"):
                hero.hurl(enemy)
            else:
                if hero.isReady("chain-lightning"):
                    hero.cast("chain-lightning", enemy)
                else:
                    hero.attack(enemy)
                                
    if item:
        if item.type == "potion":
            if hero.health < hero.maxHealth / 1.5:
                pet.fetch(item)
    

is there anything I can do to make it work?

The sword of the forgotten has knockback, which pushes them back.

use elif, because it is just like if except that it will only work if the previous if statement returned false

Also don’t use so many else’s

Thankyou for the help. What I mean is that I am dying really early. Somehow my opponent has special boosts that I cannot access. How in the world do I beat that!
P.S: How much health does a witch have? Also, what is the best wand/staff that I can get?

I prefer the vine staff, which lets you summon burls, but the golden staff, which shoots really fast is also effective. A default witch should have 120 HP.

No, seriously, I really need help with Clash of Clones!!! Cna you please help me?

The enemy hero will have the same equipment as you, but should not use any special abilities - what do you mean when you say they have special boosts?

@maka, I barely spent time on beating this level (Used omarn and vine staff and the book of life V), didn’t they have any grow spells or anything like that?

Sorry, I meant to say they won’t use equipment special abilities – I believe heroes will use their power up ability, but they won’t use any healing spells or the like.

They also won’t be clever in how and who they attack. Nearest target is what they target.

You, as the player, can be sneaky. I like to target the archers first.

Hey everyone, I need help with my code in ClashOfClones level. My hero dies too fast. I have tried literally everything: I got the best sword, best shield with bash, then just shield and no sword, tried to attack the healthies enemy first, then just my Clone first, then just archers etc etc… I feel like I need some sort of boost or any hint. Here is my current code, which only deals w archers because my hero dies too fast anyway so why bother with other enemies:

function bashAttack(enemyWho) {
    if (enemyWho) {
        while (enemyWho.health > 0) {
            if (hero.isReady("bash")) {
                hero.bash(enemyWho);
            } else {
                hero.attack(enemyWho);
            }
        }
    }
}
var archers = hero.findByType("archer", hero.findEnemies());
var archerIndex = 0;
while (archerIndex < archers.length) {
    var archer = archers[archerIndex];
    bashAttack(archer);
    archerIndex++;
}

Use a weak sword with a good shield. Also use chain lightning if you have the emperor’s gloves.

Chaboi, that’s what i’m using right now, the basic sword and the best shield in the game. I don’t have gloves though and no money to buy it, is there a way to pass the level without them?

Have you tried the level with flags? It makes it much easier to beat than a standard attack code.

Believe it or not, I did. My hero literally ignored it. I even copy-pasted just that code for flags from the “manual”, just couple lines of code, then I’m trying to place the flags - no reaction…

Your code should be something like

while (true){
    var flag=hero.findFlag()
    var enemy=hero.findNearestEnemy()
    if flag{
       hero.pickUp(flag)
    }
    else if enemy{
        //Attack code
    }
}