I’m gonna keep it short. Please help.
# If the peasant is damaged, the flowers will shrink!
def summonSoldiers():
if hero.gold >= hero.costOf("soldier"):
hero.summon("soldier")
# Define the function: commandSoldiers
def commandSoldiers():
enemy = hero.findNearestEnemy()
soldiers = hero.findFriends()
for soldier in soldiers:
hero.command(soldier, "attack", enemy)
pass
# Define the function: pickUpNearestCoin
def pickUpNearestCoin():
hero.move(hero.findNearestItem().pos)
peasant = hero.findByType("peasant")[0]
while True:
summonSoldiers()
# commandSoldiers()
commandSoldiers()
# pickUpNearestCoin()
pickUpNearestCoin()
