[SOLVED]Restless dead help

can some one please help me this is my code

summonTypes = ['paladin']


def attack(enemy):
    if enemy:
        while (enemy.health > 0):
            if (hero.distanceTo(enemy) > 10):
                hero.move(enemy.pos)
            elif (hero.isReady("bash")):
                hero.bash(enemy)
            elif (hero.canCast('chain-lightning', enemy)):
                hero.cast('chain-lightning', enemy)
            else:
                hero.attack(enemy)


def summonTroops():
    type = summonTypes[len(hero.built) % len(summonTypes)]
    if hero.gold > hero.costOf(type):
        hero.summon(type)


def commandTroops():
    for index, friend in enumerate(hero.findFriends()):
        if friend.type == 'paladin':
            CommandPaladin(friend)


def CommandPaladin(paladin):
    if (paladin.canCast("heal") and hero.health < hero.maxHealth * 0.6):
        hero.command(paladin, "cast", "heal", hero)
    else:
        hero.command(paladin, "defend", hero)


def collectItems():
    item = hero.findNearestItem()
    while item:
        hero.move(item.pos)
        item = hero.findNearestItem()


hero.moveXY(55, 10)
hero.wait(2)
attack(hero.findNearestEnemy())
collectItems()
hero.moveXY(55, 33)
hero.moveXY(49, 37)
hero.moveXY(19, 40)
for i in range(1, 20):
    summonTroops()
commandTroops()
hero.moveXY(55, 48)
while True:
    attack(hero.findNearestEnemy())
    commandTroops()
    collectItems()

and this is my gear
image
there isn’t any error it’s just that I can defeat the rotting general and this army

okay are you a subscriber @ineedhelpwithcoding if you are I just summon burls to kill them and just kill the king myself.

He has Tauran Armor, so I assume he is a subscriber.

okay use a wizard like orman, hushbaum or nalfar to summon a few burls to take care of those pesky skeletons.

Ah yes, I remembered the time where I struggled on this level for 3 months.
I suggest you take a look at this topic and any other Restless Dead topic, there are some pretty good strategies in there.
Lydia

what it took you 3 months I did it in 1 easy peasy day

Well, it all depends on your equipment really… If you have the burl staff then it’s pretty easy with all the time you have to prepare. Using Naria or Tharin is much harder.
As for @ineedhelpwithcoding I would either use wizards as milton said, or stick to your warrior but use griffin riders and make them stay behind you to avoid receiving damage, while beating back and killing the skeletons.
Danny

2 Likes

Yes, I used Naria.
Well, it didn’t took me 3 months. I did it for 1 week. Gave up came back 3 months later. And solved in another week.
Anywho, this is getting off-topic (talk about how long it took to complete it), we should start focusing on ineedhelpwithcoding.
Lydia

Couldn’t you just combine this into one with commandPaladin?

okay so I think you should use a ranger like senick use presision rifle heal yourself throughout the battle and summon soldier. I have tested this out and it works.

Hmm, this level is all about strategy. If you want to win on leader boards because you took the least damage, then blowing them up with firetraps is the best option. Otherwise, let us know your strategy and we can help.

I used burls and got about 200 damage taken. and fire-traps can also hurt your hero since it has a splashdown effect. I recommend a different strategy

image image
Another try of @ineedhelpwithcoding to pass not his own code. Please Stop!

3 Likes

@xython is right. Please try not to copy code from GitHub as it is often a solution you don’t understand. Here at CodeCombat, we are here to learn. You do not have to use code that deal with advanced techniques. I passed Summit’s gate with only a few command functions and a stage variable. In future, use your own knowledge, knowledge that you trust. By doing this, the community here at the discourse will think you are a very advanced programmer, which could have serious consequences.

Thank you

Elijah :lion:

2 Likes

this is my new code:

hero.moveXY(57, 12)
while True:
    enemy = hero.findNearestEnemy()
    item = hero.findNearestItem()
    if enemy:
        hero.attack(enemy)
    elif item:
        hero.moveXY(item.pos.x, item.pos.y)
    hero.moveXY(19, 40)

i’m saving for the staff that can summon burls should i summon some of my own skeletons to battle them? i just got them
i just solved it thank you everyone!

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