[SOLVED] Seek-and-hide: Battle with the brawler


I really need some help. My code is failing. My character is accidentally going the wrong way and getting attacked by headhunters. Here is my code. Can you please help me?

# Gather 4 lightstones to defeat the Brawler.
# If you find a lightstone, hide.

def checkTakeHide(item):
    if item:
        # The item is here, so take it.
        hero.moveXY(item.pos.x, item.pos.y)
        # Then move to the center of the camp (40, 34)
        hero.moveXY(40, 34)

while True:
    # Move to the top right X mark.
    hero.moveXY(54, 50)
    hero.moveXY(68, 56)
    # Search for a lightstone there.
    lightstone = hero.findNearestItem()
    # Call checkTakeHide with the argument: lightstone
    hero.moveXY(12, 56)
    lightstone = hero.findNearestItem()
    # Move to the top left mark.
    # Search for a lightstone.
    # Call the checkTakeHide function.
    # Pass in the result of your search as an argument.


I just ran your code and it worked fine after commenting out the line, hero.moveXY(54, 50). I think that little extra movement in the while True: loop is causing a delay.


I tried that. Is there any other code which can work? For me this code failed! My character still goes and runs into a headhunter who kills him.


It worked fine for me so it could be an equipment problem. Can you post a screenshot of the gear you’re using? What boots are you using? Maybe your hero is too slow.


Here is the image:


try using the softened leather boots. they’re a little faster and may give you what you need.


Still failing miserably, with the same issue as before. Is there any other code that I can use? This code is failing!!!


No, it isn’t failing. It works fine. We don’t give code out on this board so please don’t ask. We’re here to help you solve any issues, not just give answers.


@Anastasia do you want to join my clan? Pls do cuz i want to get at least 100 people in my clan. The link is in my profile


Alright. But let’s make a deal. I have my own clan, but no-one has joined it apart from me. If I join yours, can you please join mine? Just search “Artemis Coders” to find mine. Deal?


Ok (200000000) Can you give me the link cuz there is no search button for clans @Anastasia


are you using okar stompfoot? He’s waaay too slow. Try using a faster hero. I’m passing the level with your code using Tharin.


Our bargain is complete! I joined your one!


Finally working! Thankyou!


K Great! (20 charsss)