[SOLVED] The two flowers stuck


#1
# 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():
    friends = hero.findByType("solider")
    for friend in friends:
        enemy = friend.findNearestEnemy()
        if enemy:
            hero.command(friend, "attack", enemy)
        
# Define the function: pickUpNearestCoin
def pickUpNearestCoin():
    coin = hero.findNearestItem()
    if coin:
        hero.move(coin.pos)
    


while True:
    summonSoldiers()
    commandSoldiers()
    pickUpNearestCoin()

soldiers are not moving? what have I missed? thanks


#2
def commandSoldiers():
    friends = hero.findByType("solider")
    # code follows

soldier not solider
/ I think I answered months ago one of your first questions :slight_smile: /


#3

thanks! yea I think you did. embarrassed I missed that one :frowning: !