# 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()
defeatedOgres += 1
# Move to the right part of the map.
# This loop is executed while you have less than 30 gold.
while hero.gold < 30:
# Find and collect coins.
item = hero.findNearestItem()
# Move to the exit.
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
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
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.
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.