# You cannot collect coins.
# Summon peasants to collect coins for you.
# Collecting coins spawns a growing 'tail' behind the peasants.
# When a peasant touches a tail, they are destroyed.
# Collect 200 gold to pass the level.
# The following APIs are available on your team's peasants: "snakeBackward"
# The following APIs are available on neutral peasants: "snakeBackward", "snakeHead", "snakeForward"
while True:
friends = hero.findFriends()
tails = hero.findEnemies()
coins = hero.findItems()
for friend in friends:
# Command the peasant to collect a coin, while avoiding the tails.
if hero.canCast("haste", friend):
hero.cast("haste", friend)
elif hero.isReady("reset-cooldown") and not friend.hasEffect("haste"):
hero.resetCooldown("haste")
hero.command(friend, "move", friend.findNearest(coins).pos);
The problem is that you aren’t using a wizard. You can’t cast haste unless you have an elemental codex (idk which one), which you can only equip to a wizard. Try using Hushbaum or Pender if you don’t have any of the more costly wizards.