I'm trying to craft a custom LuaText that changes the color of the unit frame's name if it has a bleed on it, but it isn't working for some reason. I also added UNIT_AURA to the event list. Anyone know what is wrong with it?
local buff1 = UnitAura(Name(unit),"Mangle (Cat)","HARMFUL")
local buff2 = UnitAura(Name(unit),"Trauma","HARMFUL")
if ( buff1 or buff2 ) then
return '|cffff0000%s',Name(unit)
else
return '%s',Name(unit)
end
Ok. I fixed it. Whenever Mangle or Trauma is on the target, the target's name is red.
local buff1 = UnitAura("target","Mangle (Cat)",nil,"HARMFUL")
local buff2 = UnitAura("target","Trauma",nil,"HARMFUL")
if ( buff1 or buff2 ) then
return '|cffff0000%s',Name(unit)
else
return '%s',Name(unit)
end
[PHP]Spell = "Demonic Circle: Teleport"
Spell2 = "Demonic Circle: Summon"
UsableSpell = IsUsableSpell(Spell)
SpellName,_,SpellIcon = UnitBuff(unit, Spell2)
if SpellName == Spell2 then
UpdateIn(1)
if UsableSpell == 1 then
Alpha(1)
return "|T%s:25|t",SpellIcon
else
Alpha(0.5)
return "|T%s:25|t",SpellIcon
end
else
return nil
end[/PHP]
In short it shows an icon when I can use my teleport, it fades it out when I'm out of range of my summoned circle, and disappears entirely if I have no circle up.
What I want however is to change the colour of the icon so that it is red if I'm out of range too.
I tried |cFFFF0000 obviously but I guess that only works on text, so I was wondering how I might do this, anyone know?
I'm strugeling on this one, help would be appreciated. Somehow it isnt working out. Should show colored timer if its my shield and unicolored timer if it isnt mine.
Outline()
local _, _, _, _, _, _, expires, caster, _ = UnitAura(unit,"Sacred Shield")
if caster == "player" then
local rem = - (GetTime() - expires)
UpdateIn(0.25)
if rem > 45 then
return "|cff00ff00%d|r", rem
elseif rem >30 then
return "|cffffff00%d|r", rem
elseif rem > 15 then
return "|cffffa500%d|r",rem
elseif rem > 0 then
return "|cffff0000%d|r",rem
end
elseif caster ~= "player" then
local rem = - (GetTime() - expires)
UpdateIn(0.25)
if rem > 0 then
return "|cffffff00%d|r", rem
end
end
I like to have buffs show up as short coloured text next to my group and raid frames. I've got this working lovely on my priest, with Fort and Spi showing if people don't have those buffs, and Sh, R, M and Shielded showing up if people do have the relevant buffs.
However as I like to have a universal appearance between characters, and I like to tweak my layout every other week or so, I was trying to condense the two into one luatext which checks player class then uses the appropriate bit, so that I didn't have to use a seperate layout on each character.
Try as I might I just get errors about not ending functions properly or I get no error, but no text either. Would anyone be good enough to help me with this or point me in the right direction please?
Edit: Spent some more time trying things out and got an error I could work with and managed to get what I wanted working. In case anyone else wants something similar here's what I'm using:
local englishClass = UnitClass("player")
local i = 1
local fort,spirit,shadow,renew,mend,shield = true,true,false,false,false,false
local wild,thorns,rejuv,regrow= true,false,false,false
while true do
local name = UnitAura(unit,i,HELPFUL)
if not name then
break
elseif name == "Prayer of Fortitude" or name == "Power Word: Fortitude" then
fort = false
elseif name == "Prayer of Spirit" or name == "Divine Spirit" then
spirit = false
elseif name == "Prayer of Shadow Protection" or name == "Shadow Protection" then
shadow = true
elseif name == "Renew" then
renew = true
elseif name == "Prayer of Mending" then
mend = true
elseif name == "Power Word: Shield" then
shield = true
elseif name == "Mark of the Wild" or name == "Gift of the Wild" then
wild = false
elseif name == "Thorns" then
thorns = true
elseif name == "Rejuvenation" then
rejuv = true
elseif name =="Regrowth" then
regrow = true
end
i = i + 1
end
if englishClass == "Priest" then
return "|cff00BFFF%s|r |cff99FFFF%s|r |cffCC33FF%s|r |cff3FFF3F%s|r |cffE6CE77%s|r %s",fort and "Fort" or '',spirit and "Spi" or '',shadow and "Sh" or '',renew and "R" or '',mend and "M" or '',shield and "Shielded" or ''
elseif englishClass == "Druid" then
return "|cffBA55D3%s|r |cffCD6839%s|r |cff9900cc%s|r |cff33FF33%s|r",wild and "Wild" or '',thorns and "Th" or '',rejuv and "R" or '',regrow and "Re" or ''
end
I'd like to share the code I use to force a 25/10man raid layout when inside a 25/10man raid instance, the purpose for this code is for those of you who use layouts for 40man that are scaled down and when you raid your guild has more than 25 people in the raid waiting to be subbed in or whatnot. This will force it to only show the raid 25 layout (set the raid 25layout to only shows groups 1-5 and it will hide the other groups)
Step 1:
Add two new events go to the pitbull menu, go to modules, go to lua texts, in the new event box your going to add in three differant ones, both of update for checklist should be set to "player"
Now go create a new lua text for your player layout Below the text box use the event dropdown menu and select, PLAYER_ENTERING_WORLD, RAID_ROSTER_UPDATE, and ZONE_CHANGED_NEW_AREA.
This is the code I used for this:
local zone = GetRealZoneText()
local inInstance, instanceType = IsInInstance()
if inInstance and instanceType == "raid" then
if zone == "Icecrown Citadel" or zone == "Trial of the Crusader" or zone == "Ulduar" or zone == "Vault of Archavon" or zone == "The Eye of Eternity" or zone == "The Obsidian Sanctum" or zone == "Onyxia's Lair" or zone == "Naxxramas" or zone == "Sunwell Plateau" or zone == "Black Temple" or zone == "Hyjal Summit" or zone == "The Eye" or zone == "Serpentshrine Cavern" or zone == "Magtheridon's Lair" or zone == "Gruul's Lair" or zone == "Zul'Aman" or zone == "Karazhan" or zone == "Zul'Gurub" or zone == "Ruins of Ahn'Qiraj" then
PitBull4.StateHeader:SetAttribute("forced_state","raid25")
else
PitBull4.StateHeader:SetAttribute("forced_state",nil)
end
else
PitBull4.StateHeader:SetAttribute("forced_state",nil)
end
When you enter any of those raids now it will force pitbull to use a layout that is shown in Raid25 only, anything else won't be shown.
Note: this should work with just PLAYER_ENTERING_WORLD because that fires everytime you enter an instance but for some reason it isn't.
Hey everyone, I've got a pretty simple question that I just can't seem to find the answer to. I've got my health text set up to change color depending upon the amount of HP I have left. This is working fine and dandy, the only problem is it's using WoW's built in HP colors. I want it to use the colors I have set for my HP bar in Pitbull. Is this possible? Here is my code:
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 = HPColour(cur)
return "|cff%02x%02x%02x%s|r",r,g,b,cur
else
return ''
end
Is there a way to add spacing preceding a text to compensate for the portrait when the text is attached to the unit frame? I know you can add spaces (" ") or a blank icon, but those are not ideal solutions.
Like i said, i want ONLY realm, not name or anything if at all possible :p
So, something like that?
Worked like a charm, thanks
This btw will return a {err} for anyone on your realm.
This should work for all servers.
[PHP]Spell = "Demonic Circle: Teleport"
Spell2 = "Demonic Circle: Summon"
UsableSpell = IsUsableSpell(Spell)
SpellName,_,SpellIcon = UnitBuff(unit, Spell2)
if SpellName == Spell2 then
UpdateIn(1)
if UsableSpell == 1 then
Alpha(1)
return "|T%s:25|t",SpellIcon
else
Alpha(0.5)
return "|T%s:25|t",SpellIcon
end
else
return nil
end[/PHP]
In short it shows an icon when I can use my teleport, it fades it out when I'm out of range of my summoned circle, and disappears entirely if I have no circle up.
What I want however is to change the colour of the icon so that it is red if I'm out of range too.
I tried |cFFFF0000 obviously but I guess that only works on text, so I was wondering how I might do this, anyone know?
Thanks in advance :)
is it possible to add offsets to the texts? i've tried a little bit around, but couldn't get it to work yet...
Thanks :>
R
a
i
d
1
vs
Raid1
I like to have buffs show up as short coloured text next to my group and raid frames. I've got this working lovely on my priest, with Fort and Spi showing if people don't have those buffs, and Sh, R, M and Shielded showing up if people do have the relevant buffs.
However as I like to have a universal appearance between characters, and I like to tweak my layout every other week or so, I was trying to condense the two into one luatext which checks player class then uses the appropriate bit, so that I didn't have to use a seperate layout on each character.
Try as I might I just get errors about not ending functions properly or I get no error, but no text either. Would anyone be good enough to help me with this or point me in the right direction please?
Edit: Spent some more time trying things out and got an error I could work with and managed to get what I wanted working. In case anyone else wants something similar here's what I'm using:
Step 1:
Add two new events go to the pitbull menu, go to modules, go to lua texts, in the new event box your going to add in three differant ones, both of update for checklist should be set to "player"
Type in exactly this:
PLAYER_ENTERING_WORLD
RAID_ROSTER_UPDATE
ZONE_CHANGED_NEW_AREA
Now go create a new lua text for your player layout Below the text box use the event dropdown menu and select, PLAYER_ENTERING_WORLD, RAID_ROSTER_UPDATE, and ZONE_CHANGED_NEW_AREA.
This is the code I used for this:
When you enter any of those raids now it will force pitbull to use a layout that is shown in Raid25 only, anything else won't be shown.
Note: this should work with just PLAYER_ENTERING_WORLD because that fires everytime you enter an instance but for some reason it isn't.
thanks in advance!
Any ideas?