If it helps I've already made what you're working on. Only issue is when the powertype returns values I haven't included. I'm not sure when they'd be used. Like #5/Runes (when is this used?), #4/Happiness (when is this returned instead of 2/focus when used on hunter pets?), 7, 8 for vehicles.
local cur, max, type = Power(unit), MaxPower(unit), UnitPowerType(unit)
if type == 0 or type == 3 or type == 2 then
if cur == max then
return ''
end
elseif type == 1 or type == 6 then
if cur == 0 then
return ''
end
end
return "%s/%s",Short(cur,true),Short(max,true)
I made the following with a little inspiration from you
if UnitIsDeadOrGhost(unit) ~= 1 then
local type1, type2 = UnitPowerType(unit)
if type1 == 1 or type1 == 6 then
local cur = Power(unit)
if cur > 0 then
local max = MaxPower(unit)
return "%s/%s %s",cur,max,type2
end
elseif type1==0 or type1==2 or type1==3 then
local cur, max = Power(unit), MaxPower(unit)
if cur < max then
return "%s/%s %s",cur,max,type2
end
end
end
Sounds like a great idea to me, gief some more advanced stuff i can "steal" for now since i just can't seem to find any material for studying .lua properly :p
dunno if its advanced, but I'm making a text for:
(current power)/(max power) (power type)
hidden if (power type)=rage/runic and (current power)=0
hidden if (power type)=mana/energy and (current power)=(max power)
maybe we should make a "interresting LuaText's" forum thread like the dogtag one. I would love to see what other people come up with, I were pretty good with dogtags, but I have not coded anything besides that, so this is a bit challenging.
and the
local text = AFK(unit) or DND(unit)
if not text then
local pvp = PVPDuration(unit)
if pvp then
text = FormatDuration(pvp)
end
end
if text then
return "|cffff0000%s|r",text
end
you posted earlier is {err}'ing on me when not dnd/afk'ing
cant get Status(unit) to work (only tested on mobs) using the built in health absolute short.
"local s = Status(unit)
if s then
return s
end
return "%s/%s",Short(HP(unit),true),Short(MaxHP(unit),true)"
aka I killed a mob and it only showed up as (example) 0/324 where I would think it should be "Dead 0/324"
0
I made the following with a little inspiration from you
0
dunno if its advanced, but I'm making a text for:
(current power)/(max power) (power type)
hidden if (power type)=rage/runic and (current power)=0
hidden if (power type)=mana/energy and (current power)=(max power)
gotta start somewhere :)
0
0
you were right, PB wasnt updated.
another isue:
throws a {err} at me, is it just my code or?
0
and the
local text = AFK(unit) or DND(unit)
if not text then
local pvp = PVPDuration(unit)
if pvp then
text = FormatDuration(pvp)
end
end
if text then
return "|cffff0000%s|r",text
end
you posted earlier is {err}'ing on me when not dnd/afk'ing
keep up the good work :)
0
"local s = Status(unit)
if s then
return s
end
return "%s/%s",Short(HP(unit),true),Short(MaxHP(unit),true)"
aka I killed a mob and it only showed up as (example) 0/324 where I would think it should be "Dead 0/324"