Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Kithgard Brawl, Backwoods Brawl, Backwoods Treasure, Sarven Brawl, Sarven Treasure, Sarven Siege, Cloudrip Brawl

code in Kithgard Brawl


code in Backwoods Brawl

code in Backwoods Treasure

code in Sarven Brawl

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        if hero.distanceTo(enemy) <= 60:
            
        
            hero.attack(enemy)
            if hero.canCast("chain-lightning", enemy):
                hero.cast("chain-lightning", enemy)
        soldier = hero.findFriends()
        if hero.gold >= 20:
            hero.summon("soldier")
            if soldier > len("soldier"):
                
                hero.command(soldier, "attack", enemy)
                soldierIndex+=1
        if enemy.type == "sand-yak":
            hero.moveXY(17, 115)

code in Sarven Treasure


code in Sarven Siege

code in Cloudrip Brawl

# Stay alive for one minute.
# If you win, the next time you play will be more difficult and more rewarding!
# If you lose, you must wait a day before submitting again.
while True:
    coin = hero.findNearestItem()
    hero.move(coin.pos)
    if hero.gold >= hero.costOf("soldier"):
        soldier = hero.summon("soldier")
    enemy = hero.findNearest(hero.findEnemies())
    if enemy:
        soldiers = hero.findFriends()
        soldierIndex = 0
        while soldierIndex < len(soldiers):
            soldier = soldiers[soldierIndex]
            soldierIndex += 1
            hero.command(soldier, "attack", enemy)
        if hero.distanceTo(enemy) < 10:
            hero.attack(enemy)
            if hero.canCast("chain-lightning", enemy):
                hero.cast("chain-lightning", enemy)
            if hero.isReady("bash"):
                hero.bash(enemy)
    
1 Like

so do you need help or something else?

With replayable levels we can’t really help with your code if its right but we can give recomendations.

1 Like

i found something

make sure there is an enemy

if you need soldiers use hero.findByType("soldier") .and you dont really need the

this is my recommendation,

My Way

use something like

def print():
    print("hello")
def printMore():
    print("hello this is")
def printMost():
  print("hello this is my way")
while True:
    print()
    printMore()
    printMost()

i used the something like if enemy and enemy.type != "sand-yak":

hope this helped :slight_smile:

Thanks! (2000000000)

My tips: in brawls try to shield, because when you go to enemy and attack you lose many health. In treasures, try not to attack enemy too, try to collect coins/gems using invisibility or something. Also, it’s good to use speed ring, you will faster collect coins/gems.

In Sarven Siege, try to defend one tower, I personally choose the left one.

For this I know I’m a little late but with your kithgard brawl code you have if hero.isReady(“cleave”):
but you are using runesword and runesword does not have cleave.

2 Likes