Hey guys, pls help me with my code:
def findEnemyHero():
enemyHero = None
bestHealth = 0
for enemy in hero.findEnemies():
if enemy.maxHealth > bestHealth:
bestHealth = enemy.health
enemyHero = enemy
return enemyHero
def onSpawn():
while True:
eh = findEnemyHero()
if eh:
pet.moveXY(eh.pos.x, eh.pos.y)
pet.shapeShift()
pet.on("spawn", onSpawn)
while True:
enemy = hero.findNearestEnemy()
if hero.isReady("backstab"):
if hero.isReady("hide"):
hero.hide()
continue
elif hero.isReady("invisibility") and not hero.hasEffect("hide"):
hero.cast("invisibility", hero)
continue
if enemy:
eh = findEnemyHero()
hero.backstab(eh)
if enemy:
hero.scattershot(enemy)
if enemy and enemy.target == hero:
if hero.isReady("punch"):
hero.punch(enemy)
I just wanna go around and around and don’t let warrior touch me lol
And also, if you can let my pet go around and around too, pls help me too