Help shine getter [help]

this aint workin

while True:
    
    coins = hero.findItems()
    coinIndex = 0 
    while coinIndex < len(coins):
        coin = coins[coinIndex]
        if coin.value == 3:
            pos = coin.pos
            x = pos.x
            y = pos.y
            hero.moveXY(x, y)
            coinIndex += 1

omg someones replying

1 Like

you need to increment coinIndex even if you don’t pick up the coin
otherwise it keeps checking coins for the same coin over and over which is leading to an infinite loop

wdym im confused im just a kid my brain cant process that

1 Like

right now the

coinIndex += 1

is within the

if coin.value == 3:

so if the coin’s value is not 3 coinIndex doesn’t change and it keeps checking the same coin

just need to move

coinIndex += 1

out of the if statement

out of which if statement @JustALuke

i just changed my code and i only get 93 gold

while True:
    
    coins = hero.findItems()
    coinIndex = 0 
    while coinIndex < len(coins):
        coin = coins[coinIndex]
        coinIndex += 1
        if coin.value == 3:
            pos = coin.pos
            x = pos.x
            y = pos.y
            hero.moveXY(x, y)

are you there? @JustALuke

hello? @JustALuke i really need help

no need to ping multiple times :laughing:
I went to sleep after that

I tested your code and it worked for me
perhaps your hero is too slow (like Okar)
if so you can either switch to a base hero or equip items that give you more speed

1 Like

Hey so yes, Luke is helping you which is kind of him and he is choosing to do, not required. However, he’s also got a life so pls give him (and anybody else who wishes to help you out) time to respond. We are also all in different time periods, so please keep the other person’s time in mind :)

1 Like

thanks i was using okar

1 Like

i only pinged him twice

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.