Help on summit’s gate!

Hi this is my code. I manage to destroy the beam towers. Then, 2 palidans come out the door and heal me. Then my hero does nothing.
Please help!

This is my gear:

Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.

Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.

def attack():
enemy = hero.findNearestEnemy()
if enemy and enemy.type == “catapult”:
hero.moveXY(87, 34)
hero.attack(enemy)
if enemy and enemy.type == “tower”:
hero.attack(enemy)
if hero.health < 100:
hero.moveXY(167, 34)
else:
if enemy:

        hero.attack(enemy)

def commandArcher(archer):

if hero.gold > 100:
    hero.summon("archer")
    hero.summon("archer")
    hero.summon("archer")
    hero.summon("archer")

    
    
for friend in hero.findByType("archer"):
    tower = hero.findByType("tower")
    enemy = archer.findNearestEnemy()
    if enemy:
        hero.command(friend, "attack", enemy)

def commandSoldier(soldier):
friends = hero.findFriends()
for friend in hero.findByType(“soldier”):
catapult = hero.findByType(“catapult”)
catapult = hero.findByType(“catapult”) # returns an array
catapult = friend.findNearest(hero.findByType(“catapult”))
if catapult:

        hero.command(friend, "move", {'x': catapult.pos.x, 'y': catapult.pos.y})

def commandPaladin(paladin):
enemy = paladin.findNearestEnemy()
friends = hero.findFriends()
for friend in friends:
if paladin.canCast(“heal”) and hero.health <= 2000:
hero.command(paladin, “cast”, “heal”, hero)
elif enemy:
hero.command(paladin, “attack”, enemy)

def commandFriends():
friends = hero.findFriends()
for friend in friends:
if friend.type == “paladin”:
commandPaladin(friend)strong text
if friend.type == “archer”:
commandArcher(friend)
if friend.type == “soldier”:
commandSoldier(friend)

while True:
commandFriends()
attack

1 Like

I don’t know how to format!

1 Like

Can you send a screenshot of what happens and when your hero dies.

1 Like

Hero no die. He just stand by the destroyed beam towers

use flags. 20chars. 20ch

Hey @Destroyer636 great question. It seems like the others know what your problem is so I am just going to remind you to format your code properly

So lets say this is your code:

hero.FindNearestEnemy()
hero.say()

When you properly format your code it would become:

hero.findNearestEnemy() hero.say()

You can format your code by putting one of these:

`

Before and after you code!

Cya around

:wolf::wolf::wolf:

You need to format using the </> buttons above the text

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.