Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Siege of Stonehold [Help Python] [Solved]


This is my code. The character won’t move to the flag to pick it up.

# Help your friends beat the minions that Thoktar sends against you.
# You'll need great equipment and strategy to win.
# Flags might help, but it's up to you–be creative!
# There is a doctor behind the fence. Move to the X to get healed!
flag = hero.findflag("green")
enemy = hero.findNearestEnemy()

while True:
    if flag:
    elif enemy:
        if hero.isReady("cleave"):

Your current code just looks for the flag once at the beginning. Move the flag variable line into the while True loop and it will always be checking for a flag. You’ll want to do the same with the enemy variable, move that into the while True to make sure your hero is always looking for one.


Okay, I’ll try that really quick.


Thank you @brooksy125, for your help it worked.


You are welcome! Glad to help. :nerd_face: