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


#21

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
    checkTakeHide(lightstone)
    hero.moveXY(12, 56)
    lightstone = hero.findNearestItem()
    checkTakeHide(lightstone)
    # Move to the top left mark.
    
    # Search for a lightstone.
    
    # Call the checkTakeHide function.
    # Pass in the result of your search as an argument.
    
    


#22

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.


#23

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.


#24

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.


#25

Here is the image:


#26

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


#27

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


#28

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.


#29

@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


#30

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?


#31

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


#32

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.


#33

Our bargain is complete! I joined your one!


#34

Finally working! Thankyou!


#35

K Great! (20 charsss)