# Sarven Siege/help/ advice

**URL:** <https://discourse.codecombat.com/t/sarven-siege-help-advice/27841>\
**Category:** Level Help\
**Created:** [March 9, 2021, 7:44pm UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841 "2021-03-09T19:44:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Some\_Guy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/some_guy/32/20317_2.png) [@Some\_Guy](https://discourse.codecombat.com/u/Some_Guy)\
**Post date:** [March 9, 2021, 7:44pm UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841/1 "2021-03-09T19:44:11Z")

</div>

I am trying to find the Arrow tower with the lowest health but im unsure of how to implement it

```python
coin = hero.findItems()
Up = 83, 77
Mid = 83, 51
Down = 84, 22
friend = hero.findNearestFriend()
soldierIndex = 0
friends = hero.findFriends()

def lowestHealthATfriend():
    lowestHealth = 99999
    lowestFriend = None
    friends = hero.findFriends()
    if friends.type == "arrow-tower":
        ATfriend = hero.findNearestFriend()
    for ATfriend in friends:
        if friend.type == 'ATfriend':
            continue
    if friend.health < lowestHealth and friend.health < friend.maxHealth:
        lowestHealth = friend.health
        lowestFriend = ATfriend

while True:
    Up = 83, 77
    Mid = 83, 51
    Down = 84, 22
    items = hero.findItems()
    bestItem = None
    bestValue = 0
    itemsIndex = 0
    # Loop over the items array.
    # Find the item with the highest valueOverDistance()
    if friends.type == "arrow-tower":
        ATfriend = hero.findNearestFriend()
    while itemsIndex < len(items):
        item = items[itemsIndex]
        if item.value / hero.distanceTo(item) > bestValue:
            bestItem = item
            bestValue = item.value / hero.distanceTo(item)
        itemsIndex += 1
    if bestItem:
        if hero.isReady("jump"):
            hero.jumpTo(bestItem)
        hero.moveXY(bestItem.pos.x, bestItem.pos.y)
    if hero.gold >= 20 :
        x = ATfriend.pos.x + 6
        y = ATfriend.pos.y
        hero.moveXY(x, y)

```

im new to coding so if i miss something obvious would you please be patient with me

---

<div class="post-metadata">

**Author:** ![milton.jinich](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/milton.jinich/32/21419_2.png) [@milton.jinich](https://discourse.codecombat.com/u/milton.jinich)\
**Post date:** [March 9, 2021, 7:45pm UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841/2 "2021-03-09T19:45:48Z")

</div>

I think @Deadpool198 should help you with this.

---

<div class="post-metadata">

**Author:** ![RangerGrant9307](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/rangergrant9307/32/26001_2.png) [@RangerGrant9307](https://discourse.codecombat.com/u/RangerGrant9307)\
**Post date:** [March 9, 2021, 8:02pm UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841/3 "2021-03-09T20:02:59Z")

</div>

You should summon archers and soldiers to defend the tower. You might also want a paladin to heal. Ignore this post if you don’t have boss star 2 or higher

---

<div class="post-metadata">

**Author:** ![lukas31](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lukas31/32/22892_2.png) [@lukas31](https://discourse.codecombat.com/u/lukas31)\
**Post date:** [March 9, 2021, 9:43pm UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841/4 "2021-03-09T21:43:17Z")

</div>

Who is your hero and what is your armour. We help develop a strategy

---

<div class="post-metadata">

**Author:** ![Some\_Guy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/some_guy/32/20317_2.png) [@Some\_Guy](https://discourse.codecombat.com/u/Some_Guy)\
**Post date:** [March 9, 2021, 9:55pm UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841/5 "2021-03-09T21:55:57Z")

</div>

Hello sorry i forgot to send snapshot

 ![Equipment](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/e/c/ec1646e57276f6aa712eef6ea2e7c4de567aaac5.png)

---

<div class="post-metadata">

**Author:** ![lukas31](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lukas31/32/22892_2.png) [@lukas31](https://discourse.codecombat.com/u/lukas31)\
**Post date:** [March 9, 2021, 9:59pm UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841/6 "2021-03-09T21:59:31Z")

</div>

Hmmmm. Since you do not have boss star, there is no point collecting coins. I would just camp at one tower (preferably top or bottom) camp there, and attack enemy that are close

---

<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:** [March 9, 2021, 10:14pm UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841/7 "2021-03-09T22:14:21Z")

</div>

actually if you have 20 gold and is standing on a red x then it auto summons soldiers

---

<div class="post-metadata">

**Author:** ![lukas31](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lukas31/32/22892_2.png) [@lukas31](https://discourse.codecombat.com/u/lukas31)\
**Post date:** [March 10, 2021, 5:24am UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841/8 "2021-03-10T05:24:19Z")

</div>

Never knew that 20 chars

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/a/a9445509d1a758c41b5ddcddc8c8e20a5dedb67f.png) [@system](https://discourse.codecombat.com/u/system)\
**Post date:** [March 10, 2021, 5:24pm UTC](https://discourse.codecombat.com/t/sarven-siege-help-advice/27841/9 "2021-03-10T17:24:43Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
