Sarven brawl请求帮助!!!!!help me

这一关,如何生存2分钟?空闲时间如何移动,如果在移动时,如何攻击目标,放弃移动?

# Stay alive for two minutes.
# If you win, it gets harder (and more rewarding).
# If you lose, you must wait a day before you can resubmit.
# Remember, each submission gets a new random seed.
loop:
    enemies = self.findEnemies()
    enemiesindex = 0
    while enemiesindex < len(enemies):
        enemy = enemies[enemiesindex]
        enemiesindex += 1
        
        if enemy.type != "sand-yak":
            while enemy.health > 0:
                if self.isReady("bash"):
                    self.bash(enemy)
                else:
                    self.attack(enemy)
        elif self.findNearest(enemies):
            self.moveXY(93, 70)

这一关好不容易!

试试用 flags 来逃避太危险的敌人。

OK,谢谢你的提醒,我回头去试试,你有过关的代码示例嘛?让我参考下!!!!

只要加上一些关于捡起旗子的代码还有你的智慧就行。当然你的英雄要够强大去挑战。
Just add some codes about picking flags and your wise.And of course your hero must be strong enough to challenge.

OK,thank you,你有QQ嘛?我的QQ是986285,不懂的可以向你请求帮助嘛?也就是说前期必须使用flags来完成,

试了下,用distanceTo来计算和怪物之间的距离,是可以完成任务的,谢谢!

我用的是判断x坐标的距离 若大于这个值就往回走40