Sarven Brawl/ python/ Won't find enemy [Solved]

My character does fine until about a third way through where they suddenly can’t change enemy

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        if hero.distanceTo(enemy) < 50:
            if enemy.type != 'sand-yak' :
                if hero.isReady("cleave"):
                    hero.cleave(enemy)
                if hero.isReady("punch"):
                    hero.punch(enemy)
                if hero.isReady("bash"):
                    hero.bash(enemy)
                else:
                    hero.attack(enemy)
            else:
                hero.moveXY(28, 67)
    else:
        hero.moveXY(37, 69)
        hero.shield(enemy)

I’ve seen a lot of problems with the shield function, try equipping ur best gear but don’t use the shield function in your code, otherwise, I’ll answer in a few minutes.

could you please send a screenshot or the description of the error? i found a few minor problems but they do not affect the battle i think. for isReady punch and bash, use elif, as else refers to the bash attack cooldown. Also try using if enemy and enemy.type != 'sand-yak': instead of your code, as I think at some point your hero got stuck in a place where he could not see enemies but was still searching for sand yaks to exclude from the loop. Also it may be a visual bug where your hero dies, as judging from your gear’s commands, it probably wont be able to survive the onslaught. I have the best stuff in the game sorry if im a bit bossy or expect better gear. Also since you have the longsword, and you are using it, Brawlers are extremely tanky and require 10 hits. So mabye your hero is focused on one brawler, while the rest just well, kill you. So send a error screenshot or tell if you have a red cross circle under your hero

Its no longer showing an error so thank you!
Also I don’t use the longsword i bought a sword that one hits most of them

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.