coins = hero.findItems()
coinIndex = 0
# Wrap this into a loop that iterates over all coins.
while coinIndex < len(coins):
coin = coins[coinIndex]
# Gold coins are worth 3.
x = coin.pos.x
y = coin.pos.y
if coin.value == 3:
# Only pick up gold coins.
hero.moveXY(x,y)
pass
Hi @CocoCharlie here on the discourse we don’t post solutions, the purpose of discourse is to let others learn not simply providing the code, so please delete the solution.
“It doesn’t matter what the result is, what matters is how you achieved the result.” Said a wise man. (The Wise Man I’m referring to is me)