ZAX155
September 19, 2022, 12:41pm
1
I keep on having success when i run the code. But when I submit it, it runs out of time. I don’t know what is wrong with it. Is this a bug or is this a error with my code? My code is below:
enemy = hero.findNearest(hero.findEnemies())
while hero.distanceTo(hero.findNearest(hero.findEnemies())) > 10:
enemy = hero.findNearest(hero.findEnemies())
hero.cleave(hero.findNearest(hero.findEnemies()))
hero.moveXY(115, 12)
enemy = hero.findNearest(hero.findEnemies())
while enemy :
enemy = hero.findNearest(hero.findEnemies())
if hero.isReady("cleave") :
hero.cleave(enemy)
ready = hero.isReady("bash")
else :
hero.attack(enemy)
hero.moveXY(12, 12)
This is a subscriber level. I am using Hattori. And my gear is the following:
Please help me.
ZAX155
September 19, 2022, 12:43pm
3
Anonym
September 19, 2022, 12:48pm
5
Ah, sorry, can’t help you with this one. I brute-forced it with good gear and flags (yep, yep)
ZAX155
September 19, 2022, 12:50pm
6
Even when I do that, I still run out of time.
New code:
while hero.distanceTo(hero.findNearest(hero.findEnemies())) > 10:
enemy = hero.findNearest(hero.findEnemies())
hero.cleave(hero.findNearest(hero.findEnemies()))
hero.moveXY(115, 12)
enemy = hero.findNearest(hero.findEnemies())
while enemy:
enemy = hero.findNearest(hero.findEnemies())
if hero.isReady("cleave") :
hero.cleave(enemy)
ready = hero.isReady("bash")
else:
hero.attack(enemy)
hero.moveXY(12, 12)
Ah, nope. Sorry. Turns out I also
I’ll try the level again without flags if you want though.
ZAX155
September 19, 2022, 12:53pm
8
I am just gonna submit until i pass it now.