It doesn’t work.
bug: labeled
bug type: argument error: you need something to cast upon.
#sample
#paladin = hero.findNearest(hero.findByType("paladin"))
#if paladin.canCast("heal", hero):
# hero.command(paladin, "cast", "heal", hero)
#starts here
# Your goal is to protect Reynaldo
# Find the paladin with the lowest health.
def lowestHealthPaladin():
lowestHealth = 99999
lowestFriend = None
friends = hero.findFriends()
for friend in friends:
if friend.type != "paladin":
continue
if friend.health < lowestHealth and friend.health < friend.maxHealth:
lowestHealth = friend.health
lowestFriend = friend
return lowestFriend
def commandPaladin(p):
# Heal the paladin with the lowest health using lowestHealthPaladin()
# You can use paladin.canCast("heal") and command(paladin, "cast", "heal", target)
# Paladins can also shield: command(paladin, "shield")
# And don't forget, they can attack, too
weak = lowestHealthPaladin()
if p.canCast("heal", weak):
#bug
hero.command(p, "cast", "heal", weak)
else:
hero.command(p, "shield")
pass
#peasent commanded, not shown
#griffin command, not shown
def commandFriends():
# Command your friends.
friends = hero.findFriends()
for friend in friends:
if friend.type == "peasant":
commandPeasant(friend)
elif friend.type == "griffin-rider":
commandGriffin(friend)
elif friend.type == "paladin":
commandPaladin(friend)
#All commandable
#boss star 3
while True:
commandFriends()
if hero.gold >= 50:
hero.summon("griffin-rider")
What’s wrong? misspelled? Several times already!