Clash of Clones Help!

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?