when my hero tries to command my soldier
he just stands freezes and i get an error
while True:
# Collect gold.
item = hero.findNearestItem()
if item:
hero.moveXY(item.pos.x, item.pos.y)
# If you have enough gold, summon a soldier.
if hero.gold > hero.costOf("soldier"):
hero.summon("soldier")
# Use a for-loop to command each soldier.
for friend in hero.findFriends():
if friend.type == "soldier":
enemy = friend.findNearestEnemy()
hero.command(friend, "move", (47, 52)
# If there's an enemy, command her to attack.
if enemy:
hero.command(friend, "attack", enemy)
elif soldier.health < 100:
friend.moveXY(6, 47)
# Careful! If your soldiers are defeated, a warlock will appear!
# Otherwise, move her to the right side of the map.
can you guys help me find out what the problem is
and how to command my soldiers
cause i havent played in a while so i forgot a bit