# Summon some soldiers, then direct them to your base.
# Each soldier costs 20 gold.
"while hero.gold > hero.costOf("soldier"):
hero.summon("soldier")
soldiers = hero.findFriends()
soldierIndex = 0
# Add a while loop to command all the soldiers.
friends = hero.findFriends()
while soldierIndex < len(friends):
hero.findFriends()
if friends:
hero.command(soldier, "move", {"x": 50, "y": 40})
hero.moveXY(50, 40)"
# Summon some soldiers, then direct them to your base.
# Each soldier costs 20 gold.
while hero.gold > hero.costOf("soldier"):
hero.summon("soldier")
soldiers = hero.findFriends()
soldierIndex = 0
# Add a while loop to command all the soldiers.
friends = hero.findFriends()
while soldierIndex < len(friends):
hero.findFriends()
if friends:
hero.command(soldier, "move", {"x": 50, "y": 40})
hero.moveXY(50, 40)