# Hero not doing anything

**URL:** <https://discourse.codecombat.com/t/hero-not-doing-anything/1732>\
**Category:** Uncategorized\
**Created:** [December 11, 2014, 8:41am UTC](https://discourse.codecombat.com/t/hero-not-doing-anything/1732 "2014-12-11T08:41:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drdinosaur](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/drdinosaur/32/1712_2.png) [@drdinosaur](https://discourse.codecombat.com/u/drdinosaur)\
**Post date:** [December 11, 2014, 8:41am UTC](https://discourse.codecombat.com/t/hero-not-doing-anything/1732/1 "2014-12-11T08:41:11Z")

</div>

I’m on the final forest level and my hero isn’t doing anything at all. There are no syntax errors. What’s up? Thanks.

```python
flag = self.findFlag()
enemy = self.findNearest(self.findEnemies())
loop:
    if flag:
        #pos = flag.pos
        #fx = pos.x
        #fy = pos.y
        #self.moveXY(fx, fy)
        self.pickUpFlag(flag)
    elif enemy:
        if self.isReady("cleave"):
            self.cleave(enemy)
        elif self.isReady("bash"):
            self.bash(enemy)
        else:
            self.attack(enemy)

```

---

<div class="post-metadata">

**Author:** ![Rarst](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/rarst/32/1674_2.png) [@Rarst](https://discourse.codecombat.com/u/Rarst)\
**Post date:** [December 11, 2014, 8:48am UTC](https://discourse.codecombat.com/t/hero-not-doing-anything/1732/2 "2014-12-11T08:48:19Z")

</div>

You need to find the things inside the loop or you only do that _once_.

---

<div class="post-metadata">

**Author:** ![drdinosaur](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/drdinosaur/32/1712_2.png) [@drdinosaur](https://discourse.codecombat.com/u/drdinosaur)\
**Post date:** [December 11, 2014, 9:10am UTC](https://discourse.codecombat.com/t/hero-not-doing-anything/1732/3 "2014-12-11T09:10:10Z")

</div>

Thought it was something dumb. Thanks.
