My code isn’t working, it gets stuck on the line enemy = self.findNearest(toattack)
in the while True:
loop. Any ideas?
def trylure():
self.moveXY(22, 36)
self.moveXY(37,36)
enemies = self.findEnemies()
archers = [zenemy for zenemy in enemies if zenemy.type == "archer"]
toattack = []
for archer in archers:
self.attack(archer)
for thetype in enemies:
if thetype.type != 'sand-yak':
if thetype.type != 'archer':
toattack.append(thetype)
while True:
enemy = self.findNearest(toattack)
while enemy.health > 0:
self.attack(enemy)