# To grab the most gold quickly, just go after gold coins.
while True:
coins = hero.findItems()
coinIndex = 0
# Wrap this into a loop that iterates over all coins.
while coinIndex < len(coins):
# Gold coins are worth 3.
if coins.value == 3:
# Only pick up gold coins.
hero.moveXY(coins.pos.x, coins.pos.y)
coinIndex += 1
pass

while True:
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.
if coins.value == 3:
# Only pick up gold coins.
hero.moveXY(coins.pos.x, coins.pos.y)
coinIndex += 1
pass

while True:
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.
if coins.value == 3:
# Only pick up gold coins.
hero.moveXY(coin.pos.x, coin.pos.y)
coinIndex += 1
pass

while True:
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.
if coins.value == 3:
# Only pick up gold coins.
hero.moveXY(coin.pos.x, coin.pos.y)
coinIndex += 1
pass

You define the variable, coin, but don’t use it. Coins is plural. Coins cannot have a value equal to 3 because coins is an array. Look closely at what you’ve written.

i solved it but i need help with another code
well i have problem with wishing well
ill write my code here and if you can resend me with corrected errors