I recommend that you just find the nearest enemy, and if that enemy’s type is not equal to “sand-yak”, then attack the enemy. Rangers work best to attack from afar, this way you won’t have to move if you have a decent ranged weapon.
THanks for those pointers, I think that mostly fixed the problem, and the append thing I shouldve seen, but anyways, It still attacks the yak, and I am not utilizing the notYak thing, and I think that that is the prob. ANy tips?
def removeByType(enemies, excludedType):
tempList = 
for enemy in enemies:
if enemy.type != excludedType:
hero.say("leave that yak alone!")
enemies = hero.findEnemies()
notYak = removeByType(enemies, "sand-yak")
enemy = hero.findNearest(enemies)