Help me on this please


#1

signal corpse help me it does not work

while True:
green = hero.findFlag(“green”)
black = hero.findFlag(“black”)
nearest = hero.findNearestEnemy()

if green:
    greenX = greenflag.pos.x
    greenY = greenflag.pos.y
    hero.moveXY(greenX, greenY)
    hero.pickUpFlag("green")
elif black and hero.isReady("cleave"):
    hero.pickUpFlag("black")
    # Cleave!
    hero.cleave(enemy)
elif nearest and hero.distanceTo(nearest) < 10:
    # Attack!
    hero.attack(enemy)
    pass

#2

Can you be a bit more descriptive about what your problem is? It’s hard to help if we don’t know what the problem is. The best i could suggest right now would be that “hero.cleave(enemy)” and “hero.attack(enemy)” don’t have enemy clarified! You clarify your nearest enemy in the variable as “Nearest” so try changing it to “hero.cleave(nearest)” and “hero.attack(nearest)”. Let me know if it works! :grinning:


#3

@Keen_Do Are you sure about these lines of code:

nearest = hero.findNearestEnemy() 

 

hero.cleave(enemy)