[SOLVED] Detect Sparkbomb in Harrowland

I am wondering how to dodge sparkbombs, they do more than 300 damage so I want to avoid them.
Here’s what I tried

while True:
    missiles = hero.findEnemyMissiles()
    bomb = None
    bombPos = Vector(0, 0)
    for missile in missiles:
        if missile.type == 'spark-bomb':
            bomb = missile
            bombPos = missile.pos
    if bomb and hero.distanceTo(bomb.targetPos) < 5:
        if hero.distanceTo(bombPos) < 10:
            hero.blink(Vector(26, 49))

I also have the twilight glasses
Screen Shot 2020-03-25 at 12.15.00 PM

Maybe try automatic blinking

But how do I detect it

You don’t have to! It’s automatic.

But I also need to attack

I can phase shift before It hits me so I need to know when the sparkbomb is about to hit me.

Well, you can use a function to automatically blink and put it into your while loop, therefore every time you attack, you blink. I have a function that does that.

That will lower my dps and I don’t want to waste my blink every second.

I found this and it’s still not working.

while True:
    missiles = hero.findEnemyMissiles()
    bomb = None
    bombPos = Vector(0, 0)
    for missile in missiles:
        if missile.type == 'sparkbomb-missile':
            bomb = missile
            bombPos = missile.pos
    if bomb and hero.distanceTo(bomb.targetPos) < 5:
        if hero.distanceTo(bombPos) < 10:
            hero.blink(Vector(26, 49))
1 Like

I figured it out
Use the missile id

for missile in missiles:
    name = missile.id
    if name == 'Sparkbomb Missile':
        bomb = missile
        bombPos = missile.pos
if bomb and hero.distanceTo(bomb) < 17:
    blinkAway(bombPos)

Screen Shot 2020-03-25 at 4.49.56 PM

3 Likes