I don’t think this code structure is workable:
13 if friend.type=="paladin":
# code
24 if friend.type=="paladin":
# code
34 if (friend.pos.x < 47):
35 hero.command(friend, "move", {x : 50, y: 59})
36 if (friend.pos.y > 42):
37 hero.command(friend, "move", {x : 50, y: 39})
38 hero.command(friend, "move", {x : 78, y: 40})
You can see the conclusions of Quiz: Issuing successive commands? topic