Need some help Summit's Gate (I am new to this and am not very good)

Hey guys. I have been stuck on codecombat’s Summit’s Gate, and I had some trouble posting, and I also have no clue how to format my code on here. Anyways, I have been stuck on this for a good month now, and I coppied the code from Zero Sum. Now, while I was playing with the code, trying to fix it, an error message pops up all of the sudden, saying “cannot read property ‘start’ of undefined” . I have not a clue what it means. Please help. (python)

@Leon_2021 You format your code using </> symbol then copy and paste your code.

For more details go here:

Oh. Thanks!

for friend in friends:
hero.command(friend, "attack", friend.findNearest(enemies))
hero.moveXY(93, 56)
hero.wait(0.7)
hero.moveXY(93, 35)
hero.wait(0.9)
hero.moveXY(85, 7)
hero.wait(0.7)
hero.moveXY(57, 29)
while True:
    item = hero.findNearestItem()
    flag = hero.findFlag("green")
    enemies = hero.findEnemies()
    enemy = hero.findNearestEnemy()
    friends = hero.findFriends()
    if hero.time > 81:
        for friend in friends:
            hero.command(friend, "attack", friend.findNearest(enemies))
    item = hero.findNearestItem()
    flag = hero.findFlag("green")
    enemies = hero.findEnemies()
    enemy = hero.findNearestEnemy()
    # Your hero can collect coins and summon troops.
    hero.command(friend, "attack", frien
    hero.command(friend, "attack", friend.findNearest(enemies))
    
    if hero.gold > hero.costOf("soldier"):
        hero.summon("soldier")
    friends = hero.findFriends()
    if flag:
        hero.pickUpFlag(flag)
        if enemy:
            friends = hero.findFriends()
            for friend in friends:
                hero.command(friend, "attack", friend.findNearest(enemies))
            hero.attack(enemy)
        else:
            hero.command(friend, "move", hero.pos)
        if hero.isReady("invisibility"):
            hero.cast("invisibility", self)
1 Like

THANKS! :grinning::grinning::grinning::grinning:

Note that this is the code from zero sum, along with some of my own additions.:smirk:

Do you need help with zero sum or Summits gate?

Summit’s Gate. THE CODE IS FROM ZERO SUM!

@Leon_2021 dont post the correct code for zero sum if you did.

The code stopped working for zero sum.:no_mouth:

Oof XD :no_mouth::no_mouth::no_mouth:

I don’t know what that means.

Anyways, is my code okay?

What means?:face_with_raised_eyebrow:

let me check. :yum::yum::yum::yum:

The oof xd thing???

I actually do fine until the warlock pops up. Then my army decides to attack the towers.:dizzy_face:

it just means oof. :joy::joy::joy::joy::joy:

oh. :sweat_smile: (this is 20 characters(not))

I usually submit when i try, because I need to place flags.