So my problem is that i can’t get enough gold in time. Those robots pass through me and then I cant catch up. I have sword of forgotten but it takes quite some time to kill them.
while True: coin = hero.findNearest(hero.findItems()) # While a coin exists: while coin: # Move to the coin. hero.moveXY(coin.pos.x, coin.pos.y) # Reassign the coin variable to the nearest item. coin = hero.findNearestItem() pass enemy = hero.findNearestEnemy() if enemy and enemy.health > 0: # While enemy's health is greater than 0. hero.attack(enemy) pass