[SOLVED] Double Cheek Level Help

# Kill at least 6 ogres on the left side.
# Then, collect at least 30 gold on the right.
# This variable is used for counting ogres.
defeatedOgres = 0;

# This loop is executed while "defeatedOgres" is less than 6.
while defeatedOgres < 6:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
        defeatedOgres += 1
    else:
        hero.say("Ogres!")

# Move to the right part of the map.
hero.moveXY(49, 36)

# This loop is executed while you have less than 30 gold.
while hero.gold < 30:
    # Find and collect coins.
    item = hero.findNearestItem()
    if item:
        hero.moveXY(item.pos.x, item.pos.y)
# Move to the exit.
hero.moveXY(76, 32)

Whenever I run the level with this code, it just returns to statement execution limit on line 22, here is a screenshot of the error if you need it:

A statement execution limit error is triggered when the program does the same command multiple times in a row. That being said, I’m not sure why this is the case. You might try to do hero.move(item.pos), it tends to be less problematic to use the hero.move() command.

I’m quite sure that a statement execution limit error is triggered when a browser (or something else) has too many things to do

Your code works for me, could you send your equipment? Maybe you didn’t equip boots or equipped the wrong ones.

There might just be too many items in that seed, Peter

1 Like

Or, you used the wrong equipment, like for me, I used the move boot, but I’m using Ritic, so the code for Ritic is this basically the code except there’s blink, which is way easier but longer since the total of blink takes an impressive 0.25s, but cooldown is 1s.
But, if you don’t have ritic, you can just use the move boot, like this:

Would you please remove the code you put?

It’s basicly a solution, and posting solutions isnt allowed. You can post hints but not full pieces of code.

1 Like

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