[SOLVED] Mountain Mercenaries help please [python]

My hero moves, collects coins and summons soldiers, and my soldiers attack enemies. But my soldiers get overwhelmed by enemies and die. while my hero is left running around collecting coins to eventually die to the enemies.

while True:
    coin = self.findNearestItem()
    if hero.gold > hero.costOf("soldier"):
    enemy = hero.findNearest(hero.findEnemies())
    if enemy:
        soldiers = hero.findFriends()
        soldierIndex = 0
        soldier = soldiers[soldierIndex]
        while soldierIndex < len(soldiers):
            soldier = soldiers[soldierIndex]
            hero.command(soldier, "attack", enemy)
            soldierIndex +=1

Hi exotic, welcome to the CodeCombat discourse!
Your code works for me… The soldiers kill all the ogres. Could you show me your equipment and the level screen. (In a screenshot)

1 Like

Thanks for the reply,
I just managed to complete it, when you asked to look at my equipment it made me question it.
I replaced my boots with faster ones and it completed.
Thanks for the help

1 Like