In Backwoods treasure and several others; at a late stage in the code run, it will highlight an enemy but not attack them properly. Interestingly in this case I can still see my cleave periodically triggering but that one enemy is invincible and eventually finishes killing me. This code worked correctly for the first run but now becomes stuck at the end of the first quadrant.
# Collect 100 gold from two or three groves.
# If you win, it gets harder (and more rewarding).
# If you lose, you must wait a day before you can resubmit.
# Remember, each submission gets a new random seed.
def home():
hero.moveXY(39, 32)
#limits character sections of the map triggering cleave as cooldown expires, when no more coins spawn, it breaks and directs the character to another section.
def northEast():
while True:
enemy = hero.findNearestEnemy()
if enemy:
if hero.isReady("cleave"):
hero.cleave()
coin = hero.findNearestItem()
if coin:
if (coin.pos.x > 43) and (coin.pos.y > 34):
hero.moveXY(coin.pos.x, coin.pos.y)
else:
break
def southEast():
while True:
enemy = hero.findNearestEnemy()
if enemy:
if hero.isReady("cleave"):
hero.cleave()
coin = hero.findNearestItem()
if coin:
if coin.pos.x > 43 and coin.pos.y < 34:
hero.moveXY(coin.pos.x, coin.pos.y)
else:
break
def west():
while True:
if hero.isReady("cleave"):
hero.cleave()
coin = hero.findNearestItem()
if coin:
if coin.pos.x < 43:
hero.moveXY(coin.pos.x, coin.pos.y)
else:
break
while-True:
hero.moveXY(60, 16)
southEast()
home()
hero.moveXY(60, 51)
northEast()
home()
hero.moveXY(16, 33)
west()
home()