#Health % include absorb.
19 messages ยท Page 1 of 1 (latest)
With custom text.
How hard is it, and what are the chances it takes 2 min to make?
function()
local shieldPct = (aura_env.state.absorb / aura_env.state.maxhealth) * 100
return aura_env.state.percenthealth + shieldPct
end
probably but might need to add formatting to remove decimal (the cogwheel w "format options")
also assuming that's your only trigger
So should this be in a custom trigger or custom text?
%c
function()
local shieldPct = (aura_env.state.absorb or 0) / aura_env.state.maxhealth * 100
return aura_env.state.percenthealth + shieldPct
end
maybe
2x Lua error in aura 'New 3': Custom Text Function
WeakAuras Version: 5.6.0
[string "return function()"]:2: attempt to perform arithmetic on field 'maxhealth' (a nil value)
[string "return function()"]:2: in function <[string "return function()"]:1>
[string "=[C]"]: in function `xpcall'
[string "@WeakAuras/WeakAuras.lua"]:4572: in function `RunCustomTextFunc'
[string "@WeakAuras/RegionTypes/Text.lua"]:202: in function `Update'
[string "@WeakAuras/WeakAuras.lua"]:4304: in function <WeakAuras/WeakAuras.lua:4301>
[string "@WeakAuras/WeakAuras.lua"]:4397: in function <WeakAuras/WeakAuras.lua:4359>
[string "@WeakAuras/WeakAuras.lua"]:4507: in function `UpdatedTriggerState'
[string "@WeakAuras/WeakAuras.lua"]:4235: in function `UpdateFakeStatesFor'
[string "@WeakAuras/WeakAuras.lua"]:4208: in function `FakeStatesFor'
[string "@WeakAuras/WeakAuras.lua"]:3028: in function <WeakAuras/WeakAuras.lua:2883>
[string "@WeakAuras/WeakAuras.lua"]:3051: in function `Add'
[string "@WeakAurasOptions/CommonOptions.lua"]:1422: in function <WeakAurasOptions/CommonOptions.lua:1413>
[string "=[C]"]: ?
[string "@Ace3/AceConfig-3.0-3/AceConfigDialog-3.0-86/AceConfigDialog-3.0.lua"]:45: in function <...nfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua:43>
[string "@Ace3/AceConfig-3.0-3/AceConfigDialog-3.0-86/AceConfigDialog-3.0.lua"]:836: in function <...nfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua:658>
[string "=[C]"]: ?
[string "@Ace3/AceGUI-3.0-41/AceGUI-3.0.lua"]:66: in function <Ace3/AceGUI-3.0/AceGUI-3.0.lua:64>
[string "@Ace3/AceGUI-3.0-41/AceGUI-3.0.lua"]:300: in function `Fire'
[string "@WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasMultiLineEditBox.lua"]:59: in function <...I-Widgets/AceGUIWidget-WeakAurasMultiLineEditBox.lua:56>
Locals:
(*temporary) = 0
(*temporary) = nil
(*temporary) = "attempt to perform arithmetic on field 'maxhealth' (a nil value)"
Comes with this error when I try to do smartgroup.
ye, noticed trying it now, little unexpected
function()
if aura_env.state.absorb and aura_env.state.maxhealth then
return aura_env.state.percenthealth + aura_env.state.absorb / aura_env.state.maxhealth * 100
else
return aura_env.state.percenthealth
end
end
Well well, no error so far.