Basin Stampede Issues

# Uh oh, a stampede! Use your cunning to make it to the oasis.

while True:
    enemy = hero.findNearestEnemy()
    xPos = hero.pos.x + 1
    yPos = 17
    if enemy:
        # You only need to shift up/down 1m to dodge the yaks!
        if enemy.pos.y > hero.pos.y:
            # If the Yak is above you, adjust yPos downwards!
            yPos = hero.pos.y - 1
            pass
        elif enemy.pos.y < hero.pos.y:
            # If the Yak is below you, adjust yPos upwards!
            yPos = hero.pos.y + 1
            pass
    hero.moveXY(xPos, yPos)

This is python but I always keep going down 1m and then die by the stampede

Remember that locating this in the loop will always reset your yPos to 17