i am having an issue with eh level wishing well. My character only goes and collects about 20 coins and then stands there saying Non statis. my code is as follows

’’'

less = "Nimis"

more = "Non satis"

requiredGold = 104

# This function calculates the sum of coin values.

def sumCoinValues(coins):

i = 0

total = 0

while i < len(coins):

total += coins[i].value

i += 1

return total

while True:

items = hero.findItems()

goldAmount = sumCoinValues(items)

if len(items) != 0:

# If there is not enough gold, then say “Non satis”.

if goldAmount < 104:

hero.say(“non satis”)

if goldAmount >104:

hero.say(“Nimis”)

if goldAmount == 104:

coins = hero.findItems()

coinIndex = 0

nearest = coin

nearestDistance = 9999

while coinIndex < len(coins):

coin = coins[coinIndex]

coinIndex += 1

distance = hero.distanceTo(coin)

if distance < nearestDistance:

nearest = coin

nearestDistance = distance

if nearest:

hero.moveXY(nearest.pos.x, nearest.pos.y)

’’’