even though i have the ring of skeletons it is giving me an error that “team humans cant command team
ogres”
this is my code can somebody help me pls?
def buildArmy():
# Your hero can summon and command allied troops.
buildOrder = ["paladin"]
type = buildOrder[len(self.built) % len(buildOrder)]
if self.gold >= self.costOf(type):
self.summon(type)
carter= ({"x": 94, "y": 35})
def friendGetCoin():
friends = self.findFriends()
for friend in friends:
if friend.type is "peasant":
nearest = friend.findNearest(friend.findItems())
if nearest:
self.command(friend, "move", nearest.pos)
def onSpawn(e):
while True:
enemy = pet.findNearestByType("munchkin")
# Find and fetch a "potion":
pet.trick()
# Find and fetch a "potion":
pet.say("Master you are the best!!")
pet.moveXY(hero.pos.x, hero.pos.y)
pet.on("spawn", onSpawn)
hero.moveXY(111, 35)
hero.cast("summon-burl")
hero.resetCooldown("summon-burl")
hero.cast("summon-burl")
hero.cast("summon-undead")
hero.manaBlast()
hero.move(carter)
loop:
friendGetCoin()
buildArmy()
paladin = pet.findNearestByType("paladin")
friends = self.findFriends()
friend = hero.findNearest(hero.findFriends())
enemy = self.findNearest(self.findEnemies())
if enemy:
hero.attack(enemy)
if hero.isReady("mana-blast") and hero.distanceTo(enemy)<11:
hero.manaBlast()
if hero.isReady("chain-lightning"):
hero.cast("chain-lightning", enemy)
if hero.health<501 and hero.distanceTo(enemy)<=21 and hero.isReady("drain-life") and enemy.health> 0:
hero.cast("drain-life", enemy)
if hero.isReady("poison-cloud") and hero.distanceTo(enemy)<11:
hero.cast("poison-cloud", enemy)
if hero.isReady("fear") and hero.distanceTo(enemy)<11:
hero.cast("fear", enemy)
if hero.isReady("raise-dead"):
hero.cast("raise-dead")
if friend:
for friend in friends:
if friend.type is "griffin-rider" or friend.type is "skeleton":
target = friend.findNearest(friend.findEnemies())
if target:
self.command(friend, "defend", self)
if friend.type is "paladin" :
target = friend.findNearest(friend.findEnemies())
if enemy:
self.command(friend, "defend", self)
if hero.health < 400:
hero.command(paladin, "cast", "heal", hero)
if self.isReady("summon-burl"):
self.cast("summon-burl")
if self.isReady("reset-cooldown"):
self.resetCooldown("summon-burl")
if self.isReady("summon-undead"):
hero.cast("summon-undead")