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


#1

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)


#2

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


#3

For more details go here:


#4

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)

#5

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


#6

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


#7

Do you need help with zero sum or Summits gate?


#8

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


#9

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


#10

The code stopped working for zero sum.:no_mouth:


#11

Oof XD :no_mouth::no_mouth::no_mouth:


#12

I don’t know what that means.


#13

Anyways, is my code okay?


#14

What means?:face_with_raised_eyebrow:


#15

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


#16

The oof xd thing???


#17

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


#18

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


#19

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


#20

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