Forest Storm level help - #2

My hero keeps dying from lightning

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        if enemy.type != "burl" or "thrower" < 15:
            hero.attack(enemy)
    item = hero.findNearestItem()
    if item:
        if item.type != "gem" or "mushroom" < 15:
            hero.moveXY(item.pos.x, item.pos.y)

What does this refer to?

I forgot to put in hero.distance :sweat_smile:
This is my code now but I still get hit by lightning:

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        if enemy.type != "burl" or "thrower":
            if hero.distanceTo(enemy) < 15:
                hero.attack(enemy)
    item = hero.findNearestItem()
    if item:
        if item.type != "gem" or "mushroom" :
            if hero.distanceTo(item) < 15:
                hero.moveXY(item.pos.x, item.pos.y)

I found the Solution :partying_face: Thanks for the help!!! :smile:

1 Like

Please dont post your solution as some other players might use it. I ask you to please remove it. Thanks

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