[SOLVED]Infinite Loop in Shine Getter (Sarven Desert)


#1
I'm trying to solve the level Shine Getter, but an infinitte loop error keeps popping up and Tharin won't move!
Can any of you guys help me out on this?
while True:
    coins = hero.findItems()
    coinIndex = 0
    while coinIndex < len(coins):
        coin = coins[coinIndex]
        if coin.value == 3:
            hero.moveXY(coin.pos.x, coin.pos.y)
            pass


#2

Try putting an if statement in front of the if coin.value == 3 because you’re not checking if there’s a coin before you’re checking it’s value.
Hope this helps :grin:


#3

31%20AM
41%20AM
This is what appeared:


#4

To exit from a loop you need to increment its index.


#5

Thanks, I needed that!