Why can’t find a shaman with my code? I think the problem is with the “or”, but not very sure… Any idea? I have to say that I can find the rest of enemies.
loop:
flag = self.findFlag()
enemy=self.findNearestEnemy()
if flag:
self.moveXY(flag.pos.x, flag.pos.y)
elif enemy:
if enemy.type is "ogre" or enemy.type is "thrower":
self.say(enemy.type)
if self.isReady("cleave"):
self.cleave(enemy)
else:
self.attack(enemy)
elif enemy.type is "scout" or enemy.type is "shamam":
self.say(enemy.type)
if self.isReady("cleave"):
self.cleave(enemy)
else:
self.attack(enemy)
Please review your code thoroughly. You might think you wrote it correctly, but you never know.
In fact, I suggest you just delete that line entirely, and rewrite it from scratch. No Copy/Pasting. Copy/Paste guarantees that you repeat any mistakes made from the source.
What I said may sound a bit rude, but do it anyways. If it solves the problem, great! Problem is gone.
If it doesn’t then the underlying problem may be much more complex than we think.