There is an error and I doesn’t highlight a line for me and I can’t see what is wrong.
# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
def griffinMovement(gr):
for r in range(len(gr)):
g = gr[r]
enemy = hero.findNearestEnemy()
if enemy and enemy.type == "fangrider":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(g, "attack", enemy)
elif enemy and enemy.type == "catapult":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(g, "attack", enemy)
elif enemy and enemy.type == "orge":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(g, "attack", enemy)
elif enemy and enemy.type == "thower":
hero.command(friend, "move", ( {"x":target.pos.x + h,"y": target.pos.y})
hero.command(g, "attack", enemy)
elif enemy and enemy.type == "scout":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(g, "attack", enemy)
elif enemy and enemy.type == "munchkin":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(g, "attack", enemy)
elif enemy:
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(g, "attack", enemy)
def archerMovement(ar):
for r in range(len(ar)):
a = ar[r]
enemy = hero.findNearestEnemy()
if enemy:
global h
if enemy.type == "fangrider":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(a, "attack", enemy)
elif enemy.type == "thower":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(a, "attack", enemy)
elif enemy.type == "munchkin":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(a, "attack", enemy)
elif enemy.type == "scout":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(a, "attack", enemy)
elif enemy.type == "orge":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(a, "attack", enemy)
elif enemy.type == "catapult":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(a, "attack", enemy)
elif enemy:
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(a, "attack", enemy)
def soldierMovement(so):
for o in range(len(so)):
friend = so[o]
target = hero.findNearestEnemy()
if target:
global h
if target.type == "scout":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(friend, "attack", target)
elif target.type == "munchkin":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(friend, "attack", target)
elif target.type == "thower":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(friend, "attack", target)
elif target.type == "orge":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(friend, "attack", target)
elif target.type == "catapult":
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(friend, "attack", target)
else:
hero.command(friend, "move", {"x":target.pos.x + h,"y": target.pos.y})
hero.command(friend, "attack", target)
def stuff():
for i in range(len(friends)):
friend = friends[i]
global archers
global soldiers
global griffinRiders
if friend.type == "archer":
archers.append(friend)
if friend.type == "soldier":
soldiers.append(friend)
if friend.type == "griffin-rider":
griffin.append(friend)
def heroFuntions():
enemies = hero.findEnemies()
enemy = hero.findNearestEnemy()
flagGreen = hero.findFlag("green")
flagBlack = hero.findFlag("black")
if hero.isReady("regen") and hero.health < hero.maxHealth/2:
hero.cast("regen", hero)
if flagGreen:
if enemy:
hero.attack(enemy)
if flagBlack:
if flagGreen:
hero.removeFlag(flagGreen)
hero.pickUpFlag(flagBlack)
while True:
friends = hero.findFriends()
archers = []
soldiers = []
griffin = []
stuff()
if hero.time % 2 == 0:
h = 5
else:
h = -5
griffinMovement(griffin)
if hero.time % 2 == 0:
h = 5
else:
h = -5
soldierMovement(soldiers)
if hero.time % 2 == 0:
h = 5
else:
h = -5
archerMovement(archers)
heroFuntions()
if hero.gold >= hero.costOf("griffin-rider") and hero.findFlag("violet"):
hero.pickUpFlag(hero.findFlag("violet"))
hero.summon("griffin-rider")