Originally Posted by Phanx
Code:
function()
local _, _, _, _, _, duration, expirationTime = UnitBuff("player", "Blutschild")
return expirationTime
end
|
4x Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:1864: attempt to compare number with nil
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:1864: in function `SetEventDynamics'
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:1835: in function `ActivateEvent'
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:1816: in function `ScanEvents'
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:1730: in function `ForceEvents'
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:2144: in function `ScanForLoads'
|
Originally Posted by Phanx
Code:
function()
local _, _, _, _, _, duration, expirationTime = UnitBuff("player", "Blutschild")
return expirationTime - GetTime()
end
|
9x [string "return function()..."]:3: attempt to perform arithmetic on local 'expirationTime' (a nil value)
[string "return function()..."]:3: in function `durationFunc'
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:1860: in function `SetEventDynamics'
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:1835: in function `ActivateEvent'
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:1816: in function `ScanEvents'
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:1730: in function `ForceEvents'
Interface\AddOns\WeakAuras\WeakAuras-2.0.7.lua:2144: in function `ScanForLoads'
|
Maybe i should describe my problem a little bit better.
Im working with WeakAuras 2 And i have a bar to observe my Blood Shield of my DK.
This is the function i use to show how much damage my shield can block:
Code:
function ()
local shield_value = select(15, UnitBuff("player", "Blutschild")) or 0;
shield_value = math.floor(shield_value/1000);
local max_health = UnitHealthMax("player");
max_health = math.floor(max_health/1000);
return string.format("%uk/%uk", shield_value, max_health);
end
My Trigger Code:
Code:
function()
return true
end
My Reverse Trigger Code:
Code:
function()
local a = UnitBuff("player", "Blutschild")
return a == nil
end
And now i need Code for the duration so that my bar
shows how much time is left until my shield expires.
If i use one of your codes posted above i get the
posted lua errors and the bar starts randomly in the
middle of the bar and decreases.