#Adding glow to a Alter Time weakaura when hp gain>30%

1 messages · Page 1 of 1 (latest)

minor shoal
#

Hello,

I am trying to edit this weakaura: https://wago.io/7iIjQNBEK to recognize when reactivating AT would restore more than 30% of my hp and add a glow to the WA.
I originally tried with a condition, but the glow would not be removed when the scenario was no longer the case.
I then tried creating a trigger to check for this and make a condition based on that trigger but I am not sure if I am doing this correctly, here's the trigger:


function(event, ...)
    
    if UnitHealth("player") / UnitHealthMax("player") * 100 < aura_env.health / UnitHealthMax("player") * 100 - 30 then
        return true
    end
    aura_env.health = 
UnitHealth("player")
    return false
end```
Not sure what I am doing with the events field tbh.

A CPU-efficient Alter Time tracker that changes color depending on whether Alter Time will cause you to lose health.

#

Seems I managed to fix the trigger by moving the aura_env.health = UnitHealth("player") line below the if 🤔

#

I still cannot get the untrigger function to work though

#
    if UnitHealth("player") / UnitHealthMax("player") * 100 > aura_env.health / UnitHealthMax("player") * 100 - 30 then
        return true
    end
    aura_env.health = UnitHealth("player")
    return false
end