[SOLVED]Backwoods Treasure flag help

…im going to have to get a lot of gems to get all of them…

so for sure, buy the kithsteel first??

yes get kithsteel first

I LOOK SO WIIICKEEEDDD!! omg omg omg!!

here’s my code now

while True:
    item = hero.findNearestItem()
    if item:
        item = hero.findNearestItem()
        hero.move(item.pos)
        enemy = hero.findNearestEnemy()
        if enemy and hero.canCast("chain-lightning", enemy):
            enemy = hero.findNearestEnemy()
            hero.cast("chain-lightning", enemy)
        if hero.distanceTo(enemy) <= hero.attackRange:
            if hero.isReady('cleave'):
                hero.cleave(enemy)
            else:
                hero.attack(enemy)
            if hero.isReady('bash'):
                hero.bash(enemy)
            else:
                hero.attack(enemy)
        if enemy and hero.health <= 500 :
            hero.consecrate()
        

you dont need this part as you no longer have cleave

and after this define an enemy variable

…define an enemy variable?

uhhh…give me a minute to think.

like enemy = hero.findNearestEnemy()

…oh wow. that simple…my brain has to let me sleep tonight or imma be dead tomorrow.

i alread yhave that defined…

while True:
    item = hero.findNearestItem()
    if item:
        item = hero.findNearestItem()
        hero.move(item.pos)
        enemy = hero.findNearestEnemy()
        if enemy and hero.canCast("chain-lightning", enemy):

see?

1 Like

ok ok

bug error
line 10:
distanceTo target is null.

do i have to do the define enemy again?

change this to

if enemy and hero.distanceTo(enemy)<=hero.attackRange:

and after the while true right after define enemy

while True:
    item = hero.findNearestItem()
    if item:
        item = hero.findNearestItem()
        hero.move(item.pos)
        enemy = hero.findNearestEnemy()
        if enemy and hero.canCast("chain-lightning", enemy):
            enemy = hero.findNearestEnemy()
            hero.cast("chain-lightning", enemy)
        if enemy and hero.distanceTo(enemy)<=hero.attackRange:
            hero.attack(enemy)
        if enemy and hero.health <= 500 :
            hero.consecrate()

like this?

define enemy right after this

other than that it’s good

so this is good?

while True:
    item = hero.findNearestItem()
    enemy = hero.findNearestEnemy()
    if item:
        item = hero.findNearestItem()
        hero.move(item.pos)
        enemy = hero.findNearestEnemy()
        if enemy and hero.canCast("chain-lightning", enemy):
            enemy = hero.findNearestEnemy()
            hero.cast("chain-lightning", enemy)
        if enemy and hero.distanceTo(enemy)<=hero.attackRange:
            hero.attack(enemy)
        if enemy and hero.health <= 500 :
            hero.consecrate()

yes

so i am safe to submit now?

i think so.
:crossed_fingers:

20chars

WOOHOOO!! lets see how it runs first then ill submit.

YAS YAS YAS YAS YAS!! it ran smoothly!!

TIME TO SUBMIT!!!

2 Likes

nooooo…my wifi restarted as i pressed submiitttt…
;w;

oh the humanity.