i know but somebody asked whitch heroes i have
i made so that at the beamtower before i attack my hero is shielding it works but when i need to heal my hero only stand still this is my code:
while True:
paladins = []
enemies = hero.findNearestEnemy()
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)
DJ = hero.findNearestEnemy()
if DJ:
while DJ.health > 0:
hero.bash(DJ)
hero.moveXY(277, 48)
lie = hero.findNearestEnemy()
if lie:
while lie.health > 0:
hero.bash(lie)
while True:
n00B = hero.findNearestEnemy()
if n00B:
if hero.isReady("bash"):
hero.bash(n00B)
else:
hero.attack(enemy)
what is this line
20 char
thatâs because the paladins are going to help with attacking
Wait did you learn append in mountains?
no but somebody i forgot who said i could use append so i looked how to use it
Haha. Iâm in Glacier and I donât remember how to use it. Did you really write the code by yourself?
yes why?
If you did donât use things that you havenât leared yet
Okay. Nice. Letâs help again.
That was just a question, donât be mad at me.
I donât get angry with a question
Okay.
A hint: try to use flags instead od moveXY in this level.
ok i will try it
i tried it with flags but when i use them Tharins doesnât go!
you need to write flag = hero.findFlag(âgreenâ) If flag: hero.pickUp(flag)
it still doesnât move
Did you equip flags?
yes i did
wanna see my code?
Yes, I want to. 20 chars