It "almost" solved it. Was getting "Garaddon's Darkspear Raptor", but i wanted only "Garaddon". After a quick tutorial for gsub i achieved what i wanted;P
However for raid frame it was a bit tricky to resolve driver's unitId.
Not sure if this has been addressed somewhere else, but could you share what you did to get this? The VehicleName issue is the only thing I dont like about my current Pitbull setup. I have looked around and can't seem to find the info I need to fix it.
I tried searching through this thread but didn't have much luck in finding one that works. I'm looking to have my health text colour change based on target current text. I found one person who listed what they did but it's erroring out for me. Anyone have some code for this?
Below was the code that I was trying out.
local s = Status(unit)
if s then
return s
end
local cur, max = HP(unit), MaxHP(unit)
local miss = max - cur
if miss ~= 0 then
r,g,b = HPColor(cur)
return "|cff%02x%02x%02x%s|r",r,g,b,cur
else
return ''
end
Hey all! Due to performance issues, I am finally migrating from DogTags to LuaText. I'm having some difficulty translating some things over. Any help would be greatly appreciated! :)
This one is to display on myself -- only shows DND or AFK (plus how long I've been AFK). I can get the LuaText to show AFK and the timer for it... but it won't show DND.
[Outline][(AFK or DND):Angle]
This one is for my target. Shows Level (colored by difficulty) followed by Name (colored by class). It also displays DND and AFK (plus the timer).
[Outline][Level:DifficultyColor] [Name:Truncate(28, nil):ClassColor] [(AFK or DND):Angle]
Hello, sorry if this question has been already aswered,. I tried to check both topics here and at Elitist without succes.
Outline()
local cur,max = HP(unit),MaxHP(unit)
local r,g,b = HPColor(cur,max)
if Classification(unit) = 'Elite' or 'Boss' then
return "|cff%02x%02x%02x%s|r ,r,g,b, Percent(cur,max)
end
What I'm looking for is : If is unit Boss or Elite then show percentHP else show nothing.
Outline()
local cur, max = HP(unit), MaxHP(unit)
local r, g, b = HPColor(cur, max)
local c = Classification()
if c == "Elite" or c == "Boss" then
return "|cff%02x%02x%02x%s|r ,r,g,b, Percent(cur,max)
else
return ""
end
That might work, can't test since the US is being patched atm.
I'm looking for a way to save information between luatext updates (as local seems to reset its value every time the text is updated)
If i don't declare a variable as local, it gets shared between ALL the texts (I think I may be polluting some global space >.>)
What is the accepted/correct way to do this?
An example would be a counter that goes up every time a player hits the max rage event.
If there are 3 warriors in the party how do i keep a separate counter for each warrior?
In advance - I'm sorry for possibly duplicating a past post ;[
Sometime last year I was looking for a piece of lua code that would show the raid group number I'm currently in and would automatically update on every change (shown next to Pitbull4 unit frames). Apart from the code it required declaring a new event withing pitbull itself afair. Back then I found it and it worked like a charm but my HDD got busted a few days ago and I lost my UI (along with other things). So after a few hours of searching (I'm 90% sure I found what I was looking for somewhere in here) i gave up ;[ Can't find the bloody thing.
If anyone could tell me how to do it (or point me in the direction of an existing topic) I would be very grateful.
is it possible for lua text to get the target's name? What I want to do is put my the name of my pets target on the actual pet bar so I don't need to create another unit frame just to quickly see if my pet is targeting the right mob.
In advance - I'm sorry for possibly duplicating a past post ;[
Sometime last year I was looking for a piece of lua code that would show the raid group number I'm currently in and would automatically update on every change (shown next to Pitbull4 unit frames). Apart from the code it required declaring a new event withing pitbull itself afair. Back then I found it and it worked like a charm but my HDD got busted a few days ago and I lost my UI (along with other things). So after a few hours of searching (I'm 90% sure I found what I was looking for somewhere in here) i gave up ;[ Can't find the bloody thing.
If anyone could tell me how to do it (or point me in the direction of an existing topic) I would be very grateful.
Spent a while but I finally found what I was looking for (was hiding on EJ forums). Copy-pasting for whoever might want it
Normal version
if UnitInRaid(unit) then
local size = GetNumRaidMembers()
local uname=Name(unit)
i=1
while i<=size do
local name,_,subgroup = GetRaidRosterInfo(i)
if uname==name then
return "(%s)", subgroup
end
i=i+1
end
end
Class color coded
if UnitInRaid(unit) then
local size = GetNumRaidMembers()
local r,g,b=ClassColor(unit)
local uname=Name(unit)
i=1
while i<=size do
local name,_,subgroup = GetRaidRosterInfo(i)
if uname==name then
return "|cff%02x%02x%02x(%s)|r",r,g,b,subgroup
end
i=i+1
end
end
It's also needed to add the event RAID_ROSTER_UPDATE and select Update for All.
Thanks to Hotan, from who I shamelessly ripped this off.
Hi, I have been looking all over the forum and even googled it but I cant find this simple lua Text.
This is for my raid frames. I want the Name to be shown in class colours and any name longer than 12 letters to be be abbreviated. (sometimes vehicles have very long names and they go beyond my raid frames).
In addition how would I have one or two spaces before the name as the names are too close to the edge of the Unit frame.
Thanks in advance.
This is for my raid frames. I want the Name to be shown in class colours and any name longer than 12 letters to be be abbreviated. (sometimes vehicles have very long names and they go beyond my raid frames).
In addition how would I have one or two spaces before the name as the names are too close to the edge of the Unit frame.
local class_color = ""
local _, class = UnitClass(unit)
if class then
local t = PitBull4.ClassColors[class]
local r,g,b = t[1]*255, t[2]*255, t[3]*255
class_color = ("|cff%02x%02x%02x"):format(r,g,b)
end
local short_name = Name(unit):sub(1,12)
return " %s%s|r",class_color,short_name
Is it possible to add titles to the names? Can't figure out how to do it.
For raids and battlegrounds where there are multiple groups, is it possible to list my group number next to my name? (edit: Forgot to check the last page before posting)
Looking to get help with some texts I just couldn't work out on my own..
1. AFK as 'A' or DND as 'B' and name shortened to 15 letters. DogTag equivalent I use is [(AFK ? 'A ') (DND ? 'B ') Name:Truncate(15, nil)]. Would appear as 'A Name' if AFK or just 'Name' if neither AFK/DND (Away/Busy now because of RealID).
2. Same as above but with (Status or HP) instead of the name.
3. AFK as 'A' or DND as 'B' and MissingHP or name abbreviated to 15 letters. DogTag version is [(AFK ? 'A ') (DND ? 'B ')] [(-MissingHP):Hide(0) or Name:Truncate(15, nil)].
4. Same as above but no AFK or DND, 'very short' MissingHP (i.e. -16k instead of -16,209) and name reduced to 3 letters.
If anyone could create these, that would be great! I can provide more detail if needed.
Getting tired of fail DK tanks not being in the proper presence so i was hoping to get some help making a tag to display a single letter denoting what presence the DK is using (Blood/Unholy/Frost) so i know when to hold back and when to nag at tank ;p
Is there an (easy) way to add own PROVIDED_CODES (custom default texts) to LuaText?
For example if I have a Pitbull module that adds a new bar and some API to be used via LuaText (eg. GetMaximumThreatUnitId(modId)) and I want to give user's some default LuaText to ease up module usage.
Imaging something like Tanks threat relative to (second) highest person on mobs threat list. (See Tidy-Plates)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
It should be doable since addons like PB4 are able to display a bar for the remaining time.
Below was the code that I was trying out.
This one is to display on myself -- only shows DND or AFK (plus how long I've been AFK). I can get the LuaText to show AFK and the timer for it... but it won't show DND.
This one is for my target. Shows Level (colored by difficulty) followed by Name (colored by class). It also displays DND and AFK (plus the timer).
What I'm looking for is : If is unit Boss or Elite then show percentHP else show nothing.
Could anyone point me in right direction ?
thank you in advance!
That might work, can't test since the US is being patched atm.
I'm looking for a way to save information between luatext updates (as local seems to reset its value every time the text is updated)
If i don't declare a variable as local, it gets shared between ALL the texts (I think I may be polluting some global space >.>)
What is the accepted/correct way to do this?
An example would be a counter that goes up every time a player hits the max rage event.
If there are 3 warriors in the party how do i keep a separate counter for each warrior?
Sometime last year I was looking for a piece of lua code that would show the raid group number I'm currently in and would automatically update on every change (shown next to Pitbull4 unit frames). Apart from the code it required declaring a new event withing pitbull itself afair. Back then I found it and it worked like a charm but my HDD got busted a few days ago and I lost my UI (along with other things). So after a few hours of searching (I'm 90% sure I found what I was looking for somewhere in here) i gave up ;[ Can't find the bloody thing.
If anyone could tell me how to do it (or point me in the direction of an existing topic) I would be very grateful.
Thanks. Could have sworn I tried that and it didn't work, maybe I forgot the "" or something.
Spent a while but I finally found what I was looking for (was hiding on EJ forums). Copy-pasting for whoever might want it
Normal version
Class color coded
It's also needed to add the event RAID_ROSTER_UPDATE and select Update for All.
Thanks to Hotan, from who I shamelessly ripped this off.
This is for my raid frames. I want the Name to be shown in class colours and any name longer than 12 letters to be be abbreviated. (sometimes vehicles have very long names and they go beyond my raid frames).
In addition how would I have one or two spaces before the name as the names are too close to the edge of the Unit frame.
Thanks in advance.
Adapted from code on PlusHeal.com
Is it possible to add titles to the names? Can't figure out how to do it.
For raids and battlegrounds where there are multiple groups, is it possible to list my group number next to my name? (edit: Forgot to check the last page before posting)
Yep, use UnitInRaid, it returns the 1-40 index of where the unit is in the raid. (better than looping through them all like in the above example.)
1. AFK as 'A' or DND as 'B' and name shortened to 15 letters. DogTag equivalent I use is [(AFK ? 'A ') (DND ? 'B ') Name:Truncate(15, nil)]. Would appear as 'A Name' if AFK or just 'Name' if neither AFK/DND (Away/Busy now because of RealID).
2. Same as above but with (Status or HP) instead of the name.
3. AFK as 'A' or DND as 'B' and MissingHP or name abbreviated to 15 letters. DogTag version is [(AFK ? 'A ') (DND ? 'B ')] [(-MissingHP):Hide(0) or Name:Truncate(15, nil)].
4. Same as above but no AFK or DND, 'very short' MissingHP (i.e. -16k instead of -16,209) and name reduced to 3 letters.
If anyone could create these, that would be great! I can provide more detail if needed.
Getting tired of fail DK tanks not being in the proper presence so i was hoping to get some help making a tag to display a single letter denoting what presence the DK is using (Blood/Unholy/Frost) so i know when to hold back and when to nag at tank ;p
For example if I have a Pitbull module that adds a new bar and some API to be used via LuaText (eg. GetMaximumThreatUnitId(modId)) and I want to give user's some default LuaText to ease up module usage.
Imaging something like Tanks threat relative to (second) highest person on mobs threat list. (See Tidy-Plates)