Sarven Siege/help/ advice

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

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

I think @Deadpool198 should help you with this.

2 Likes

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

1 Like

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

Hello sorry i forgot to send snapshot

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

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

Never knew that 20 chars

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