@_TD_RodYT : I don't know if this was @Simon_Yang's problem, but I'm also running into trouble.
I've followed the code offered:
# The function maybeBuildTrap defines TWO parameters!
def maybeBuildTrap(x, y):
# Use x and y as the coordinates to move to.
enemy = hero.findNearestEnemy()
# Use buildXY to build a "fire-trap" at the given x and y.
hero.buildXY("fire-trap", enemy.pos.x, enemy.pos.y)
# This calls maybeBuildTrap, with the coordinates of the top entrance.
# Now use maybeBuildTrap at the left entrance!
# Now use maybeBuildTrap at the bottom entrance!
But then my hero just goes running over to the nearest enemy, and won't build anything.
I'm tempted to cheap shot out, since I have a shield with a good bash, and could just have him bash the ogres to keep 'em off the peasants, but I'd rather try and make it through.