# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
while True:
paladins = []
enemies = hero.findNearestEnemy()
flag = hero.findFlag("green")
if flag:
hero.pickUpFlag(flag)
if hero.canCast("invisibility", hero):
hero.cast("invisibility", hero)
friends = hero.findFriends()
for friend in friends:
if friend.type == "paladin":
paladins.append(paladin)
for enemy in hero.findEnemies():
if enemy.type == "catapult":
while enemy.health > 0:
hero.attack(enemy)
hero.shield()
friends = hero.findFriends()
for friend in friends:
e = friend.findNearestEnemy()
if e:
hero.command(friend, "attack", e)
fire = hero.findNearestEnemy()
if fire:
while fire.health > 0:
hero.attack(fire)
hero.shield()
if fire.type == "tower":
pass
if hero.pos.x > 160:
hero.moveXY(175, 35)
hero.moveXY(175, 8)
hero.moveXY(245, 14)
hero.moveXY(245, 34 )
while hero.health < hero.maxHealth:
hero.moveXY(245, 35)
if hero.gold > hero.costOf("soldier"):
hero.summon("soldier")
paladin = hero.findByType("paladin")
for paladin in paladins:
if paladin:
if paladin.canCast("heal",paladin):
hero.command(paladin, "cast", "heal", hero)
if hero.maxHealth <= hero.health:
if fire:
hero.moveXY(277, 34)
hero.moveXY(277, 5)
poop = hero.findNearestEnemy()
if poop:
while poop.health > 0:
hero.bash(poop)
hero.moveXY(277, 48)
dumb = hero.findNearestEnemy()
if dumb:
while dumb.health > 0:
hero.bash(dumb)
while True:
n00B = hero.findNearestEnemy()
if n00B:
if hero.isReady("bash"):
hero.bash(n00B)
else:
hero.attack(n00B)
this is my code