HP :: Power% - Shades to red as HP and Power Percentage deplete. Can also make it green to yellow to red with a bit of work. I used some code to turn the :: separator into a combat indicator, but it could really be used for anything.
What's the best way to include a targeted player's talent tree spec (e.g. "Affliction", "Assassination", "Fury") in a text using luatext? The context is that I'm attempting to rewrite the following DogTag for my target:
What's the best way to include a targeted player's talent tree spec (e.g. "Affliction", "Assassination", "Fury") in a text using luatext? The context is that I'm attempting to rewrite the following DogTag for my target:
HRM, must have been tired last night or something, couldn't see the option to filter tanks.
hopefully last question
This without the level function
local dr,dg,db = DifficultyColor(unit)
local lvl = Level(unit)
local name = Name(unit)
if UnitIsPlayer(unit) then
local cr,cg,cb = ClassColor(unit)
local form = DruidForm(unit)
if form then
form = strsub(form,1,1)
return "|cff%02x%02x%02x%s|r |cff%02x%02x%02x%s (%s)|r" ,dr,dg,db,lvl,cr,cg,cb,name,form
else
return "|cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r" ,dr,dg,db,lvl,cr,cg,cb,name
end
else
local classif = Classification(unit)
if classif then
return "|cff%02x%02x%02x%s %s|r %s" ,dr,dg,db,lvl,classif,name
else
return "|cff%02x%02x%02x%s|r %s" ,dr,dg,db,lvl,name
end
end
I also removed the Classifcation text, because that is just an extension of level, in my opinion.
local name = Name(unit)
if UnitIsPlayer(unit) then
local cr,cg,cb = ClassColor(unit)
local form = DruidForm(unit)
if form then
form = strsub(form,1,1)
return "|cff%02x%02x%02x%s (%s)|r" ,cr,cg,cb,name,form
else
return "|cff%02x%02x%02x%s|r" ,cr,cg,cb,name
end
else
return name
end
Hi. This script for pitbull3, how to to alter it for PitBull4?
[if IsplayerOrPen then (Status or FractionalHP(known=true) or PercentHP:Percent) else (Status or FractionalHP(known=true):Short or PercentHP:Percent)]
(It who full HP if target is player or pet, and short if tar is enemy)
And where I can see PitBull 4 syntax?
go into modules, dissable luatexts, enable dogtags, and it will work like old pb3
Well, thanks for that link Kerecha. I will try to stick to LuaText. It's gonna help me to practice with Lua.
Shefki thanks for the link to documentation. BTW. Where can I save my own Lua code to use it in other profiles/bars etc?
EDIT:
I think there is error in documentation. The function name: "DifficultColor(unit)" should be "DifficultyColor(unit)". I spent a bit to find this >.<
local s = Status(unit)
if s then
return s
end
local cur, max = HP(unit), MaxHP(unit)
if UnitIsFriend(unit,"player") then
local miss = max - cur
if miss ~= 0 then
return "|cffff7f7f%d|r",miss
else
return ''
end
else
return "%s/%s",Short(cur,true),Short(max,true)
end
and this for my mana bar
local max = MaxPower(unit)
if max > 0 then
return "%s/%s",Power(unit),max
end
but it shows wrong values for both health and mana ...
is anybody here who can help me with that?
Shefki thanks for the link to documentation. BTW. Where can I save my own Lua code to use it in other profiles/bars etc?
Really only thing I can suggest right now is to copy and paste them out into a text editor and save the in a text file. There's been a request for a separate Code editor type pane so multiple layouts can share one code. But it hasn't been implemented and even if we did. I doubt we'd make multiple-profiles share the same codes.
EDIT:
I think there is error in documentation. The function name: "DifficultColor(unit)" should be "DifficultyColor(unit)". I spent a bit to find this >.<
Fixed this error and added some functions I hadn't gotten around to adding to the documentation.
but it shows wrong values for both health and mana ...
is anybody here who can help me with that?
Do you have the proper events selected. UNIT_HEALTH and UNIT_HEALTHMAX and then there's a whole bunch of events for the power bar like UNIT_MANA, UNIT_MANAMAX, UNIT_RAGE, UNIT_RAGEMAX etc
Hi. This script for pitbull3, how to to alter it for PitBull4?
[if IsplayerOrPen then (Status or FractionalHP(known=true) or PercentHP:Percent) else (Status or FractionalHP(known=true):Short or PercentHP:Percent)]
(It who full HP if target is player or pet, and short if tar is enemy)
And where I can see PitBull 4 syntax?
local s = Status(unit)
if s then
return s
end
local cur,max = HP(unit),MaxHP(unit)
if UnitIsPlayer(unit) or IsPet(unit) then
return "%s/%s",cur,max
else
return "%s/%s",Short(cur,true),Short(max,true)
end
Be sure to check UNIT_HEALTH, UNIT_HEALTHMAX and UNIT_AURA in the events checkbox. Note that the DogTag code you gave will never display the percent in WoW 3.x or newer because exact health is always known.
This isn't PB4 syntax so much as it is LuaTexts syntax. DogTagTexts is still available (which is what PB3 used) by turning on the DogTagTexts module. If you'd prefer to use that you can simply turn off LuaTexts and use the same old codes you've been using.
Do you have the proper events selected. UNIT_HEALTH and UNIT_HEALTHMAX and then there's a whole bunch of events for the power bar like UNIT_MANA, UNIT_MANAMAX, UNIT_RAGE, UNIT_RAGEMAX etc
For the health bar I have the events UNIT_AURA, UNIT_HEALTH and UNIT_HEALTHMAX selected and for the power bar UNIT_DISPLAYPOWER, UNIT_ENERGY, UNIT_FOCUS, UNIT_MANA, UNIT_MAXENERGY, UNIT_MAXFOCUS, UNIT_MAXMANA, UNIT_MAXRAGE, UNIT_MAXRUNIC_POWER, UNIT_RAGE and UNIT_RUNIC_POWER
For the health bar I have the events UNIT_AURA, UNIT_HEALTH and UNIT_HEALTHMAX selected and for the power bar UNIT_DISPLAYPOWER, UNIT_ENERGY, UNIT_FOCUS, UNIT_MANA, UNIT_MAXENERGY, UNIT_MAXFOCUS, UNIT_MAXMANA, UNIT_MAXRAGE, UNIT_MAXRUNIC_POWER, UNIT_RAGE and UNIT_RUNIC_POWER
It should work then. What makes you think that the text is displaying the wrong power/health?
And a question to the default code of the percentage energy text. The code is
local max = MaxPower(unit)
if max > 0 then
return "%s%%",Percent(Power(unit),MaxPower(unit))
end
Have I missed something or is the second call to MaxPower() not really needed?
edit: Oh, and another question:
In PitBull3 multiple colors could be configured for the castbar (casting, channelling, complete, fail). I can't find this option in Pitbull4 and I also can't find a ticket for it. Am I just blind or does really nobody miss that feature?
edit2: And I have a little problem:
My party frames are also shown if I convert the party to a raid. But in the group settings only the "show in party" option is checked. Any help would be nice :)
edit3: Oh, the party frames are only hidden if more than 5 members are in the raid. Can this be disabled somewhere?
Shameless push of my questions, and adding some more:
Could it be that there is a bug in the range check for hostile units? I'm a Paladin, so all range checks should be 40 yards. I have one layout that I use for maintanks, -targets and -targettargets. The range check works for the tanks, but the -targets (e.g. the boss) is always faded out at about 38 yards (I'm still able to cast my 40 yard Judgement on it when it's faded out).
Is there any option to disable the fading animation, so it fades instantly like in PitBull3?
Thanks for those who helped me before. Since I don't want to register for EJ just for this, how do I make this show only my Renew/PoM?
local i = 1
local renew,shield,mending = false,false,false
while true do
local name,_,icon = UnitAura(unit,i)
if not name then
break
elseif name == "Power Word: Shield" then
shield = true
elseif name == "Weakened Soul" then
shield = true
elseif name == "Renew" then
renew = true
elseif name == "Prayer of Mending" then
mending = true
end
i = i + 1
end
Outline()
return "%s%s%s",shield and "|cffFFFF00.|r" or '',renew and "|cff00C000.|r" or '',mending and "|cff00C5CD.|r" or ''
Thanks for those who helped me before. Since I don't want to register for EJ just for this, how do I make this show only my Renew/PoM?
If I'm not mistaken, this should work:
local i = 1
local renew,mending = false,false
while true do
local name,_,icon = UnitAura(unit,i)
if not name then
break
elseif name == "Renew" then
renew = true
elseif name == "Prayer of Mending" then
mending = true
end
i = i + 1
end
Outline()
return "%s%s",renew and "|cff00C000.|r" or '',mending and "|cff00C5CD.|r" or ''
tzirean: You don't need to define icon from UnitAura() since you don't use it, not that it really hurts much of anything. Also, you should add "HELPFUL" to your UnitAura() call. Also, that SetFormated is going to produce some garbage from what I remember Shefki saying. This would have the exact same appearance and be cleaner:
local i = 1
local renew,mending = false,false
while true do
local name = UnitAura(unit,i,HELPFUL)
if not name then
break
elseif name == "Renew" then
renew = true
elseif name == "Prayer of Mending" then
mending = true
end
i = i + 1
end
Outline()
return "|cff00C000%s|r|cff00C5CD%s|r",renew and "." or '',mending and "." or ''
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
What's the best way to include a targeted player's talent tree spec (e.g. "Affliction", "Assassination", "Fury") in a text using luatext? The context is that I'm attempting to rewrite the following DogTag for my target:
Apologies if this has already been answered--I haven't been able to figure out how to search through individual replies in this thread!
The last answer on the subject was here, by Shefki: http://elitistjerks.com/f32/t63351-luatexts_new_dogtags/p4/#post1297198
It's a bit more involved than it looks.
hopefully last question
This without the level function
It's me again :P
I was trying to create my own extra texts just to join colour level number with name just as white text and many other things.
Pitbull 3 had explanation of all these funtion where i can find it in Pitbull 4?
Thanks
go into modules, dissable luatexts, enable dogtags, and it will work like old pb3
Documentation for LuaTexts can be found here:
http://www.wowace.com/addons/pitbull4/pages/lua-texts/
[if IsplayerOrPen then (Status or FractionalHP(known=true) or PercentHP:Percent) else (Status or FractionalHP(known=true):Short or PercentHP:Percent)]
(It who full HP if target is player or pet, and short if tar is enemy)
And where I can see PitBull 4 syntax?
Well, thanks for that link Kerecha. I will try to stick to LuaText. It's gonna help me to practice with Lua.
Shefki thanks for the link to documentation. BTW. Where can I save my own Lua code to use it in other profiles/bars etc?
EDIT:
I think there is error in documentation. The function name: "DifficultColor(unit)" should be "DifficultyColor(unit)". I spent a bit to find this >.<
I have this lua code in my pitbull4 for Health
and this for my mana bar
but it shows wrong values for both health and mana ...
is anybody here who can help me with that?
Thank you <3
Really only thing I can suggest right now is to copy and paste them out into a text editor and save the in a text file. There's been a request for a separate Code editor type pane so multiple layouts can share one code. But it hasn't been implemented and even if we did. I doubt we'd make multiple-profiles share the same codes.
Fixed this error and added some functions I hadn't gotten around to adding to the documentation.
Do you have the proper events selected. UNIT_HEALTH and UNIT_HEALTHMAX and then there's a whole bunch of events for the power bar like UNIT_MANA, UNIT_MANAMAX, UNIT_RAGE, UNIT_RAGEMAX etc
Be sure to check UNIT_HEALTH, UNIT_HEALTHMAX and UNIT_AURA in the events checkbox. Note that the DogTag code you gave will never display the percent in WoW 3.x or newer because exact health is always known.
This isn't PB4 syntax so much as it is LuaTexts syntax. DogTagTexts is still available (which is what PB3 used) by turning on the DogTagTexts module. If you'd prefer to use that you can simply turn off LuaTexts and use the same old codes you've been using.
For documention of LuaTexts look at:
http://www.wowace.com/addons/pitbull4/pages/lua-texts/
For the health bar I have the events UNIT_AURA, UNIT_HEALTH and UNIT_HEALTHMAX selected and for the power bar UNIT_DISPLAYPOWER, UNIT_ENERGY, UNIT_FOCUS, UNIT_MANA, UNIT_MAXENERGY, UNIT_MAXFOCUS, UNIT_MAXMANA, UNIT_MAXRAGE, UNIT_MAXRUNIC_POWER, UNIT_RAGE and UNIT_RUNIC_POWER
It should work then. What makes you think that the text is displaying the wrong power/health?
Anyone? :(
If I'm not mistaken, this should work: