while True:
bestCoin = None
maxRating = 0
coinIndex = 0
coins = hero.findItems()
# Try calculating "value / distance" to decide which coins to get.
while coinIndex < len(coins):
coin = coins[coinIndex]
if coin:
distance = hero.distanceTo(coin)
if coin.value < maxRating:
maxRating = coin.value / distance
bestCoin = coin
coinIndex += 1
pass
if bestCoin:
pos = bestCoin.pos
hero.move(pos)
So the only problem, is move() doesn’t work.
Help greatly appreciated
Here is linkity link