can you guys help me to make my summoned soldiers all together attack enemy at the same time?
while True:
# Move to the nearest coin.
# Use move instead of moveXY so you can command constantly.
coins = hero.findItems()
coin = hero.findNearest(coins)
hero.move(coin.pos)
# If you have funds for a soldier, summon one.
if hero.gold > hero.costOf("soldier"):
hero.summon("soldier")
enemy = hero.findNearest(hero.findEnemies())
if enemy:
# Loop over all your soldiers and order them to attack.
soldiers = hero.findFriends()
soldierIndex = 0
soldier = soldiers[soldierIndex]
# Use the 'attack' command to make your soldiers attack.
while soldierIndex < len(soldiers):
hero.command(soldiers, "attack", enemy)
soldierIndex += 1