Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Level "Shine Getter", Nothing Happening? Python


This is my code,

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

I click run yet nothing happens not even an error just says "running…"
I have been stuck for a while not knowing if it is a bug or just my code,
so I decided to post here after looking all over google and here.


Your code may be too long. Make sure you have the right equipment…

1 Like

Could you send a screenshot?


It could be that you have a dead / infinite loop by accident or your computer is running slow.


#Do not put
coinIndex += 1
#in “if statement”.


Thank you jack! This worked I had no idea that was what I was doing wrong.

1 Like

Bravo! same problem and same solution!