I need help with Sarven Treasure! Python

Hello! I need help with Sarven Treasure. Code:

while True:
    enemy = hero.findNearestEnemy()
    item = hero.findNearestItem()
    if item:
        hero.move(item.pos)
    if enemy:
        hero.attack(enemy)

I am just a third-grader so don’t expect me to know everything. so, help! By the way, I finished all the levels. I am not a subscriber. Please help! @Deadpool198? @Eric_Tang?

Which stage are you on

I am in stage 4. Might be hard to figure out

Try to use the precious like for example if hero.distanceTo(enemy) < 5
Use the precious

ok I am trying now…

wait! There’s an error:

I used:

while True:
    enemy = hero.findNearestEnemy()
    item = hero.findNearestItem()
    if item:
        hero.move(item.pos)
    if enemy and hero.distanceTo(enemy) <= 5:
        hero.attack(enemy)


but my hero dies in a few seconds

You’re in stage four so you should probably use your special abilitys

what do you mean by “special abilities”?

Invisibly chain lightning etc

ok I am trying now…

ok, so my code:

while True:
    enemy = hero.findNearestEnemy()
    item = hero.findNearestItem()
    if item:
        hero.move(item.pos)
    if enemy and hero.distanceTo(enemy) <= 5:
        if hero.canCast("chain-lightning", enemy):
            hero.cast("chain-lightning", enemy)
        else:
            hero.attack(enemy)

my hero dies because the razor sharp blade thingy spinning in the air. How can I dodge them?

I think you can dodge them using vectors (but I don’t know how to) and there are telepoters on the side of the map

@Eric_Tang? are you there?

Yes I’m here I’m won’t leave

Ok. Can I reply to you tomorrow? My mom says I have off my Chromebook until tomorrow.

Yea sure you can go 20 chars

thanks and bye! See U tomorrow!

since you have completed the level please press the tik box that says solution next o the comment that solved the problem and someone will put the title to [Solved]. thanks.

The problem, as far as @The_Master_Coder has said, has not been solved. As he said:

He just needs to wait until tomorrow to post.
Danny