# Wait for ogres, defeat them and collect gold. while True: enemies = hero.findEnemies() # enemyIndex is used to iterate the enemies array. enemyIndex = 0 # While enemyIndex is less than len(enemies) while enemyIndex < len(enemies): # Attack the enemy at enemyIndex enemy = enemies[enemyIndex] hero.attack(enemy) # Increase enemyIndex by one. enemyIndex += 1 coins = hero.findItems() # coinIndex is used to iterate the coins array. coinIndex = 0 while coinIndex < len(coins): # Get a coin from the coins array using coinIndex coin = coins[coinsIndex] # Collect that coin. hero.moveXY(item.pos.x, item.pos.y) # Increase coinIndex by one. coinIndex += 1
how about you add an if-statement:
if enemy: hero.attack(enemy)
and for the coin:
if coin: hero.moveXY(item.pos.x, item.pos.y)
PS. Welcome back!
That should work. But it also depends on the gear as well. So, could we see your gear please?
nope doesnt work sadly oof
ima take a quick screenshot
it told me to use the cleaver
have you ever tried using cleave?
I would also implement bashing and shielding(optional) to increase your survivability rate.
nah not the shield i dont wanna use it
Instead of using
len use this:
if coin and not enemy: hero.movexy(coin.pos.x, coin.pos.y)
Because you can focus on attacking, and still pick up coins
Ring of speed also helps a LOT
you forgot to capitalize the x and y in the
Yeah. Sorry about that