# Sarven brawl 1 HELP

**URL:** <https://discourse.codecombat.com/t/sarven-brawl-1-help/26219>\
**Category:** Level Help\
**Created:** [December 21, 2020, 4:42pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219 "2020-12-21T16:42:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pameleen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pameleen/32/17789_2.png) [@Pameleen](https://discourse.codecombat.com/u/Pameleen)\
**Post date:** [December 21, 2020, 4:42pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/1 "2020-12-21T16:42:51Z")

</div>

I do not know why my hero wont attack exept the first two dudes. here is my code:

---

<div class="post-metadata">

**Author:** ![Pameleen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pameleen/32/17789_2.png) [@Pameleen](https://discourse.codecombat.com/u/Pameleen)\
**Post date:** [December 21, 2020, 4:43pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/2 "2020-12-21T16:43:18Z")

</div>

```python
while True:
    hero.moveXY(87, 71)
    enemy = hero.findNearestEnemy()
    item = hero.findNearestItem()
    if item is not None:
        hero.moveXY(item.pos.x, item.pos.y)
    if enemy is not None and enemy.type != "sand-yak":
        dist = hero.distanceTo(enemy)
        if (enemy.type == 'thrower'):
            hero.attack(enemy)
            hero.attack(enemy)
        elif (hero.isReady("power-up") and (enemy.type == "burl" or enemy.type == "ogre")):
            hero.powerUp()
        else:
            
                
                
                    
            if (hero.isReady("power-up")):
                hero.powerUp()
            else:
                hero.attack(enemy)
                hero.attack(enemy)
                hero.attack(enemy)
                hero.attack(enemy)
                hero.attack(enemy)

```

---

<div class="post-metadata">

**Author:** ![Pameleen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pameleen/32/17789_2.png) [@Pameleen](https://discourse.codecombat.com/u/Pameleen)\
**Post date:** [December 21, 2020, 4:45pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/3 "2020-12-21T16:45:29Z")

</div>

nevermind. I got it.

---

<div class="post-metadata">

**Author:** ![WaWa\_Yang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/wawa_yang/32/17800_2.png) [@WaWa\_Yang](https://discourse.codecombat.com/u/WaWa_Yang)\
**Post date:** [December 21, 2020, 4:48pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/4 "2020-12-21T16:48:19Z")

</div>

@Pameleen can you put [SOLVED] in the title?

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [December 21, 2020, 4:50pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/5 "2020-12-21T16:50:49Z")

</div>

I got it @WaWa_Yang  
20 chars

---

<div class="post-metadata">

**Author:** ![Pameleen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pameleen/32/17789_2.png) [@Pameleen](https://discourse.codecombat.com/u/Pameleen)\
**Post date:** [December 21, 2020, 5:02pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/6 "2020-12-21T17:02:31Z")

</div>

sry I just relized it did not work oops

---

<div class="post-metadata">

**Author:** ![Pameleen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pameleen/32/17789_2.png) [@Pameleen](https://discourse.codecombat.com/u/Pameleen)\
**Post date:** [December 21, 2020, 5:02pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/7 "2020-12-21T17:02:52Z")

</div>

```python
while True:
    hero.moveXY(67, 71)
    enemy = hero.findNearestEnemy()
    
    if enemy:
        hero.attack(enemy)
        hero.attack(enemy)
        if hero.isReady("cleave"):
            if :
                
            hero.cleave(enemy)
        
        else:
            hero.attack(enemy)

```

---

<div class="post-metadata">

**Author:** ![Pameleen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pameleen/32/17789_2.png) [@Pameleen](https://discourse.codecombat.com/u/Pameleen)\
**Post date:** [December 21, 2020, 5:05pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/8 "2020-12-21T17:05:56Z")

</div>

i am just going to be done for the day.

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [December 21, 2020, 5:07pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/9 "2020-12-21T17:07:12Z")

</div>

> [@Pameleen](#):
>
> ` hero.attack(enemy)`

first of all you just need one attack

> [@Pameleen](#):
>
> ```python
> if hero.isReady("cleave"):
> if :
>                 
> hero.cleave(enemy)
> 
> ```

this seems a bit messed up delete the if : after the if hero.isReady(“cleave”):

---

<div class="post-metadata">

**Author:** ![cheddarcheese](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/cheddarcheese/32/22417_2.png) [@cheddarcheese](https://discourse.codecombat.com/u/cheddarcheese)\
**Post date:** [December 21, 2020, 5:16pm UTC](https://discourse.codecombat.com/t/sarven-brawl-1-help/26219/10 "2020-12-21T17:16:37Z")

</div>

> [@Pameleen](#):
>
> `if :`

why is this extra if here?
