You can make your hero go for gold coins, or you can make your hero go for the best coins.
One way to make your hero go for the best coins is find all the coins, compare each coins value divided by your distance to them, and then move the the bestcoin.
items = hero.findItems()
bestItem = None
bestValue = 0
itemsIndex = 0
# Loop over the items array.
# Find the item with the highest valueOverDistance()
while itemsIndex < len(items):
item = items[itemsIndex]
if item.value / hero.distanceTo(item) > bestValue:
bestItem = item
bestValue = item.value / hero.distanceTo(item)
itemsIndex += 1
This does depend however on which programmaticon you have, but I find that this tactic works the best. You will come across this technique in the campaign, so if you don’t get it now, you will soon.
Hope this helps.