I have been trying to make this work for hours. I was stuck at always getting 143/150 coins and scratched it and tried a new method. Currently, my guy just runs to the top, mid-right of the map OR he teleports once and then runs to the top, mid-right. I have NO idea why he is going to (x=48, y=62). I want him to just run around picking up silver/gold coins and running into a teleporter if an ogre gets too close or no coins are near him.

```
loop:
minDistance = 20
coinIndex = 0
coins = self.findItems()
ogres = self.findEnemies()
ogre = self.findNearest(ogres)
closestCoin = self.findNearest(coins)
while coinIndex < len(coins):
target = coins[coinIndex]
coinIndex += 1
distance = self.distanceTo(target)
if distance < minDistance and target.value >= 2:
minDistance = distance
closestCoin = target
if minDistance < 30 and closestCoin and not ogre:
self.moveXY(closestCoin.pos.x, closestCoin.pos.y)
if minDistance < 30 and closestCoin and ogre:
ogreDistance = self.distanceTo(ogre)
if ogreDistance >= 10 and closestCoin:
self.moveXY(closestCoin.pos.x, closestCoin.pos.y)
elif closestCoin:
if self.pos.x > 43 and self.pos.y > 38:
self.moveXY(75, 50)
if self.pos.x > 43 and self.pos.y <= 38:
self.moveXY(75, 20)
if self.pos.x <= 43 and self.pos.y > 38:
self.moveXY(5, 50)
if self.pos.x <= 43 and self.pos.y <= 38:
self.moveXY(5, 20)
self.moveXY(closestCoin.pos.x, closestCoin.pos.y)
pass
```

I canâ€™t get the self.moveXY(variable, variable) to work at all. It always says I need to put an integer in. But if I need to move to an integer, Iâ€™ll have no way of getting him to move to the coins?