# Flag problem in Summit's Gate

**URL:** https://discourse.codecombat.com/t/flag-problem-in-summits-gate/5634
**Category:** Bugs
**Created:** [November 12, 2015, 12:13pm UTC](https://discourse.codecombat.com/t/flag-problem-in-summits-gate/5634 "2015-11-12T12:13:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Kevin\_Yuan](https://avatars.discourse-cdn.com/v4/letter/k/fbc32d/32.png) [@Kevin\_Yuan](https://discourse.codecombat.com/u/Kevin_Yuan)
#### Post date: [November 12, 2015, 12:13pm UTC](https://discourse.codecombat.com/t/flag-problem-in-summits-gate/5634/1 "2015-11-12T12:13:40Z")

</div>

Hi, I really need help on the last level of the Clouddrip Mountain area. I’m able to get past the two gates(with flags) at first, but when I reach the dungeons, my character just stays still and doesn’t move to the flag. My character is Tharin and he has the **_Runesword, Emporer’s Gloves, Gilt Wristwatch, Leather Belt, Programmaticon IV, Ring of Speed, Kithgard Worker’s Glasses, Quartz Sense Stone, The Precious, Basic Flags, Boss Star III, Enameled Dragonplate Helmet, Enameled Dragonplate, Boots of Leaping and Deflector_** Here’s my code:

```
loop:
    enemy = self.findNearest(self.findEnemies())
    if enemy:
        self.attack("Catapult")
        self.attack("Catapult 1")
        if self.canCast("chain-lightning", enemy):
            self.cast("chain-lightning", enemy)
        if self.canCast("invisibility", self):
            self.cast("invisibility", self)
        else:
            self.attack(enemy)
    
        flag = self.findFlag("green")
        if flag:
            self.jumpTo(flag.pos)
            self.pickUpFlag(flag)
        blackFlag = self.findFlag("black")
        if blackFlag:
            self.jumpTo(blackFlag.pos)
            self.pickUpFlag(blackFlag)

```

I added the black flag part just to see if it works instead of green when I reach the dungeons.  
Please help! I’ll be willing to take all comments even if they don’t work.  
Thanks a lot,  
Kevin

---

<div class="post-metadata">

### Author: ![ChronistGilver](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chronistgilver/32/3778_2.png) [@ChronistGilver](https://discourse.codecombat.com/u/ChronistGilver)
#### Post date: [November 12, 2015, 3:28pm UTC](https://discourse.codecombat.com/t/flag-problem-in-summits-gate/5634/2 "2015-11-12T15:28:56Z")

</div>

Your problem is that `jumpTo` has a cooldown. This will cause you to stay in place until the cooldown has passed. Additionally, your hero will only respond to flags if there is an enemy. When you first enter the Inner Sanctum, the wall is blocking you from seeing the six female ogres. That’s most likely your problem.

---

<div class="post-metadata">

### Author: ![ameen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ameen/32/3176_2.png) [@ameen](https://discourse.codecombat.com/u/ameen)
#### Post date: [November 12, 2015, 6:01pm UTC](https://discourse.codecombat.com/t/flag-problem-in-summits-gate/5634/3 "2015-11-12T18:01:30Z")

</div>

In your code:  
loop:  
enemy = self.findNearest(self.findEnemies())  
if enemy:  
self.attack(“Catapult”)  
self.attack(“Catapult 1”)  
if self.canCast(“chain-lightning”, enemy):  
self.cast(“chain-lightning”, enemy)  
if self.canCast(“invisibility”, self):  
self.cast(“invisibility”, self)  
else:  
self.attack(enemy)

```
    flag = self.findFlag("green")
    if flag:
        self.jumpTo(flag.pos)
        self.pickUpFlag(flag)
    blackFlag = self.findFlag("black")
    if blackFlag:
        self.jumpTo(blackFlag.pos)
        self.pickUpFlag(blackFlag)

```

The avatar will move when there is a enemy like ChronistGilver said.

---

<div class="post-metadata">

### Author: ![GundericusTheMighty](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@GundericusTheMighty](https://discourse.codecombat.com/u/GundericusTheMighty)
#### Post date: [November 12, 2015, 6:18pm UTC](https://discourse.codecombat.com/t/flag-problem-in-summits-gate/5634/4 "2015-11-12T18:18:22Z")

</div>

Please enclose your code in three backticks (`) or highlight it and click the \</\> button. This makes so we can read it as code. Thanks!

---

<div class="post-metadata">

### Author: ![Kevin\_Yuan](https://avatars.discourse-cdn.com/v4/letter/k/fbc32d/32.png) [@Kevin\_Yuan](https://discourse.codecombat.com/u/Kevin_Yuan)
#### Post date: [November 13, 2015, 6:16am UTC](https://discourse.codecombat.com/t/flag-problem-in-summits-gate/5634/5 "2015-11-13T06:16:22Z")

</div>

Thanks I’ll try that and get back to you guys!

---

<div class="post-metadata">

### Author: ![ameen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ameen/32/3176_2.png) [@ameen](https://discourse.codecombat.com/u/ameen)
#### Post date: [November 16, 2015, 2:54am UTC](https://discourse.codecombat.com/t/flag-problem-in-summits-gate/5634/6 "2015-11-16T02:54:04Z")

</div>

sorry I just realized that thanks
