[SOLVED] Dodge from okar deuing grounds

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 :pray:

Is anyone there??? :pray: :pray:

@riticmaster908 @PeterPalov @moonwatcher348 can anyone help me?

@Chaboi_3000 @Alexbrand @Aya can anyone help me?

Help guys, plsssssssss

wdym by this, i will be back in a few hours i have school :tired_face:

Basically you can make a function that:

  • checks if the distance between you and the enemy is close. if it is, you move away to maintain a certain distance
  • makes sure you dont get stuck in the corner of the screen

hopefully i understood what you want correctly and that this helps you :]

1 Like

Please don’t @ everyone… it’s really annoying sometimes and should be reserved for when you need a specific person

2 Likes

ooh, hey @PeterPalov can i share fIROP function?

lso, dont use vectors, use a list of points (thats what i use for ritic) (done thanks to Peter)

1 Like

He doesn’t use Vectors???

points = [Vector(22, 50),Vector(55, 47),Vector(57, 20),Vector(23, 18)]

Then what should i write?

No, please don’t. It is a secret between you and me.

@PeterPalov Oh, if it is a secret, can you still help me(not the code that u gave riticmaster)

Like sometimes peter can’t tell you but can tell me :wink:

I didn’t get what you want. Do you want to just move away from warriors?

Yeah, :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face:
@riticmaster908 said use points
@PeterPalov

If you want to move away, check “Skating Away” level and there literally is everything you want. Just dodge from warriors/any other melee instead of yaks.

1 Like