Before any one can help you, you need to format your code properly, otherwise it is all the same line, and you can’t see the indentation. To format your code you should click on the button on the top which looks like this </>. Then this should appear on your screen.
copy all your code into where it says, type or paste code here. Otherwise the code is not formatted properly is impossible to read.
while True:
enemy = hero.findNearestEnemy()
flag = hero.findFlag(“green”)
if enemy and hero.isReady(“cleave”):
hero.cleave(enemy)
elif flag:
hero.moveXY(19, 69)
hero.moveXY(53, 69)
elif enemy:
hero.attack(enemy)
I think it’s to do with your flags, if you don’t hero.pickUpFlag() in the elif flag: then the flag will stay there and you won’t be able to put down another one. Instead you could use hero.pickUpFlag() and you would remove the flag and move to the location of the flag. Also maybe instead of elif enemy: you could say,
else:
if enemy:
hero.attack(enemy)
maybe, I think it goes a bit weird if you have 2 elifs after each other.
Hope this helps
Did you mean to send that again? If you’re just saying hi, then… Hi!
If you could avoid posting in old topics that would be good. This one is 2 years old. Why not post in a more recent topic that’s supposed to be for non-codecombat related talk. Check out this topic:
Ok, well maybe just wait until you can and then post. There’s not that much point posting you’re going to post is there?
It just saves a few posts if you don’t.
Danny