Sarven Treasure Error

I still can’t get this to work properly. I was using the moveXY method in line 12, but once the character used the teleporter, he just kept going in and out of the same teleporter, completely ignoring the ogres and coins. Once it started processing line 12 it just got stuck there and would not continue, even though the conditions of the if statement were no longer true.

After reading this post by Harry The Wanderer I changed to the move(targetPos) method but just can’t get it to work at all. What the heck am I doing wrong?

while True:
    teleporters = [{"x":5, "y":49},{"x":5, "y":19},{"x":76, "y":51},{"x":77, "y":19}]
    teleporter = hero.findNearest(teleporters)
    telePos = teleporter
    coin = hero.findNearestItem()
    enemy = hero.findNearestEnemy()
    if enemy and hero.distanceTo(enemy) < 5:
        hero.move(telePos)
    if coin:
        hero.moveXY(coin.pos.x, coin.pos.y)