Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Help me on this please


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)
elif black and hero.isReady("cleave"):
    # Cleave!
elif nearest and hero.distanceTo(nearest) < 10:
    # Attack!


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:


@Keen_Do Are you sure about these lines of code:

nearest = hero.findNearestEnemy()