#Health % include absorb.

19 messages ยท Page 1 of 1 (latest)

lusty raven
#

Any way to include these into one?
So it would show was 110% health (example)?

pine plank
#

With custom text.

lusty raven
#

How hard is it, and what are the chances it takes 2 min to make?

visual wolf
#
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

lusty raven
#

So should this be in a custom trigger or custom text?

visual wolf
#

%c

lusty raven
#

Sweet that works!

#

Well, it works for player. but not for smart group sad. ๐Ÿ˜ฆ ๐Ÿ˜„

visual wolf
#
function()
  local shieldPct = (aura_env.state.absorb or 0) / aura_env.state.maxhealth * 100
  return aura_env.state.percenthealth + shieldPct
end

maybe

lusty raven
#
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.

visual wolf
#

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
lusty raven
#

Well well, no error so far.

visual wolf
#

the error is just that for some reason the trigger doesn't carry maxhealth at some stages, which is strange but i guess it is what it is

#

so just have to check if there is any maxhealth before calculating

lusty raven
#

I will try join a party and see if it works.

#

IT WORKS!