Code
while True:
command()
move()
def command():
friends = hero.findFriends()
witches = hero.findByType("witch")
targets = hero.findEnemies()
for witch in witches:
for friend in friends:
for target in targets:
if witch:
hero.command(friend, "attack", witch)
elif target.type != "brawler" and target.health > 0:
hero.command(friend, "attack", target)
def move():
hero.moveXY(69, 14)
hero.wait(2)
hero.moveXY(15, 14)
My code runs like this. I move to make the catapults kill the brawlers and themselves, but after my troops kill the witch, they just stop attacking. Help?