I need help figuring out the problem that I am having. Can anyone help?
This is my code.
while True: currentHealth = hero.health healingThreshold = hero.maxHealth / 2 # If your current health is less than the threshold, # move to the healing point and say, "heal me". # Otherwise, attack. You'll need to fight hard! if enemy: enemy = self.findNearestEnemy() if currentHealth < healingThreshold : hero.moveXY(65, 46) hero.say("Healing please") elif enemy: hero.shield() hero.attack(enemy) hero.attack(enemy) hero.attack(enemy)