Why is this not working?

for anomalie in anomalies:
        if anomalie.type=="teleport":
            hero.special("teleport",endX,endY)

I am trying to counter teleports but there not working.
why???
(this stratagy is inspired by @nick )

1 Like

Try something like this (you have to get endX and endY from the anomaly properties, and it helps to check if your teleport is ready):

for anomalie in hero.findActiveAnomalies():
    if anomalie.type == "teleport" and hero.isReady("teleport"):
        hero.special("teleport", anomalie.endX, anomalie.endY)
4 Likes

it is not working :frowning:
it does not do the teleport :((

1 Like

Check the documentation of 'findActiveAnomalies". It should be name property.

1 Like

so should i do anomalie.name or anomalie.type

1 Like

Read the documentation. However I’ve made both work.

1 Like