this saids error hero has no method findByType()
this is my code:
arryn=hero.findByType('raider')
def peasant():
friends=hero.findFriends()
for friend in friends:
if friend.type=="peasant":
hero.command(friend, "move", {'x':arryn.pos.x,'y':arryn.pos.y})
def hero():
friends=hero.findFriends()
for friend in friends:
if friend.type=="peasant":
hero.moveXY(friend.pos.x, friend.pos.y)
while True:
peasant()
hero()