Jump to content


LuaTexts - The new DogTags


  • Please log in to reply
234 replies to this topic

#221 Cronus

Cronus

    Glass Joe

  • Members
  • 12 posts

Posted 21 April 2010 - 09:00 AM

Is there any way to display the remaining time of temporary pets (like the untalented dk ghoul or the shaman spirit wolves)?

#222 ctrlfrk

ctrlfrk

    Glass Joe

  • Members
  • 8 posts

Posted 22 April 2010 - 03:24 AM

Is there any way to display the remaining time of temporary pets (like the untalented dk ghoul or the shaman spirit wolves)?


Yep, just call this function and return the value if it's not nil.
GetPetTimeRemaining - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons

#223 Cronus

Cronus

    Glass Joe

  • Members
  • 12 posts

Posted 22 April 2010 - 04:09 PM

Yep, just call this function and return the value if it's not nil.
GetPetTimeRemaining - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons


Awesome, thanks a lot! :)

#224 sirann

sirann

    Glass Joe

  • Members
  • 12 posts

Posted 26 April 2010 - 08:47 PM

I've done a lot of work trying to get this to come out right. It appears as tho this section of code is working. As shown, I am a rogue so I focused it on buffs that apply to me.

if select (2, UnitClass("player")) == "ROGUE" then
local f, g, k, m, wf, ur, soe, lotp, hst, dmg, crit = "|TInterface/Icons/spell_holy_prayeroffortitude:30|t", "|TInterface/Icons/spell_nature_giftofthewild:30|t", "|TInterface/Icons/spell_magic_greaterblessingofkings:30|t", "|TInterface/Icons/ability_warrior_battleshout:30|t", "|TInterface/Icons/spell_deathknight_icytalons:30|t", "|TInterface/Icons/ability_warrior_intensifyrage:30|t", "|TInterface/Icons/spell_nature_earthbindtotem:30|t", "|TInterface/Icons/spell_nature_unyeildingstamina:30|t", "|TInterface/icons/ability_paladin_swiftretribution:30|t", "|TInterface/Icons/spell_nature_starfall:30|t","|TInterface/Icons/spell_shaman_elementaloath:30|t"
UpdateIn(0.25)
if UnitAura(unit, "Fortitude") or UnitAura(unit, "Power Word: Fortitude") or UnitAura(unit, "Prayer of Fortitude") then
f = ""
end
if UnitAura(unit, "Mark of the Wild") or UnitAura(unit, "Gift of the Wild") then
g = ""
end
if UnitAura(unit, "Blessing of Kings") or UnitAura(unit, "Greater Blessing of Kings") or UnitAura(unit, "Blessing of Forgotten Kings") then
k = ""
end
if UnitAura(unit, "Battle Shout") or UnitAura(unit, "Blessing of Might") or UnitAura(unit, "Greater Blessing of Might") then
m = ""
end
if UnitAura(unit, "Improved Icy Talons") or UnitAura(unit, "Windfury Totem") then
wf = ""
end
if UnitAura(unit, "Abomination's Might") or UnitAura(unit, "Unleashed Rage") or UnitAura(unit, "Trueshot Aura") then
ur = ""
end
if UnitAura(unit, "Strength of Earth") or UnitAura(unit, "Horn of Winter") then
soe = ""
end
if UnitAura(unit, "Rampage") or UnitAura(unit, "Leader of the Pack") then
lotp = ""
end
if UnitAura(unit, "Moonkin Aura") or UnitAura(unit, "Retribution Aura") or UnitAura(unit, "Concentration Aura") or UnitAura(unit, "Devotion Aura") then
hst = ""
end
if UnitAura(unit, "Arcane Empowerment") or UnitAura(unit, "Ferocious Inspiration") or UnitAura(unit, "Retribution Aura") or UnitAura(unit, "Concentration Aura") or UnitAura(unit, "Devotion Aura") then
dmg = ""
end
if UnitAura(unit,"Elemental Oath") or UnitAura(unit, "Moonkin Aura") then
crit = ""
end
return "%s%s%s%s%s%s%s%s%s%s%s", f, g, k, m, wf, ur, soe, lotp, hst, dmg, crit
end

I dont know if this code is by any means optimized. It does work, I don't know a whole lot about coding, just enough to mimic it and get a desired product. This script will display several icons, run a loop every 0.25 seconds and check for buffs (some buffs like sanctified retribution and swift retribution had to be fudged). If it finds any of these buffs, it will remove the icon.

TL: DR, if you see an icon you're missing that equivalent buff.

I am going to start working on a debuff checker and will post it when I am finished.

Again, if you know of any ways to better ways to handle this code please feel free to post it.

#225 sirann

sirann

    Glass Joe

  • Members
  • 12 posts

Posted 26 April 2010 - 11:42 PM

As promised here are the Debuff checks I made, split into two scripts.

local sar, sag, sab = 255, 0, 0
local ffr, ffg, ffb = 255, 0, 0
local dmgr, dmgg, dmgb = 255, 0, 0
local bleedr,bleedg,bleedb = 255,0,0
local critr,critg,critb = 255,0,0
UpdateIn(0.25)
if UnitDebuff("target", "Sunder Armor") or UnitDebuff("target", "Expose Armor") then
sar, sag, sab = 0, 255, 255
end
if UnitDebuff("target", "Faerie Fire") or UnitDebuff("target", "Faerie Fire Feral") then
ffr, ffg, ffb = 0, 255, 255
end
if UnitDebuff("target", "Blood Frenzy") or UnitDebuff("target", "Blood Poisoning") then
dmgr, dmgg, dmgb = 0, 255, 255
end
if UnitDebuff("target", "Mangle (Cat)") or UnitDebuff("target", "Mangle (Bear)") or UnitDebuff("target","Trauma") then
bleedr,bleedg,bleedb = 0,255,255
end
if UnitDebuff("target","Heart of the Crusader") or UnitDebuff("target","Deadly Poison") or UnitDebuff("target","Totem of Wrath") then
critr,critg,critb = 0,255,255
end
return "|cff%02x%02x%02x20%%|r |cff%02x%02x%02x5%%|r |cff%02x%02x%02xDmg|r |cff%02x%02x%02xBleed|r |cff%02x%02x%02xCrit|r" , sar, sag, sab, ffr, ffg, ffb, dmgr, dmgg, dmgb, bleedr,bleedg,bleedb, critr,critg,critb

AND

local mdr, mdg, mdb = 255, 0, 0
local hr, hg, hb = 255, 0, 0
local scr,scg,scb = 255, 0, 0
UpdateIn(0.25)
if UnitDebuff("target", "Curse of the Elements") or UnitDebuff("target", "Earth and Moon") or UnitDebuff("target","Ebon Plague") then
mdr, mdg, mdb = 0, 255, 255
end
if UnitDebuff("target", "Faerie Fire") or UnitDebuff("target", "Misery") then
hr, hg, hb = 0, 255, 255
end
if UnitDebuff("target", "Shadow Mastery") or UnitDebuff("target", "Improved Scorch") or UnitDebuff("target","Winter's Chill") then
scr, scg, scb = 0, 255, 255
end
return "|cff%02x%02x%02x13%%|r |cff%02x%02x%02xHit|r |cff%02x%02x%02xS.Crit|r",mdr, mdg,mdb,hr,hg,hb,scr,scg,scb

Again, if you see any better way to accomplish the same thing in a more efficient manner, by all means.

#226 Antiganon

Antiganon

    Glass Joe

  • Members
  • 18 posts

Posted 15 July 2010 - 08:04 PM

So I'm working on some Raid Frames that will essentially replace grid for my non-healers. I need it to show Name (4 letters max), Missing HP (in place of name, if HP is not full), AFK/DC/FD/FI/Dead (in place of name, if unit is AFK or Offline or Feigning Death or Divine Intervention'd or Dead/Ghost).

Here is what I have so far:
local AFK = Afk(unit)
local AFKTIME = AFKDuration(unit)
local DC = Offline(unit)
local DCTIME = OfflineDuration(unit)
local DEAD = Dead(unit)
local DEADTIME = DeadDuration(unit)
local FD = UnitAura(unit,"FEIGN DEATH")
local DI = UnitAura(unit,"DIVINE INTERVENTION")
local cur,max = HP(unit),MaxHP(unit)
local miss = max-cur

if AFK then
return "AFK\n%s",AFKTIME
elseif DC then
return "DC\n%s",DCTIME
elseif DEAD then
return "AFK\n%s",DEADTIME
elseif FD then
return "FD"
elseif DI then
return "DI"
elseif miss ~= 0 then
return "- %s",Short(miss)
else
return Name(unit):sub(1,4)

So far, Name, FD (and I assume DI, since they are functionally identical with different buffs), AFK are confirmed to work. I have not tested DEAD, DC, miss.

My issue is that AFKTIME displays as a massively huge decimal number. I had a fix for this before, but I have no idea what it was.

Anyone know how to fix it?

#227 Proza

Proza

    Glass Joe

  • Members
  • 1 posts

Posted 30 July 2010 - 01:27 AM

Does anyone know how to view the unit-player's group number when in a raid? The DogTag is pretty simple, however I'm having a really hard time researching the code to display the player's group number (in Pitbull, that is).

#228 Hamsda

Hamsda

    Piston Honda

  • Members
  • 161 posts

Posted 30 July 2010 - 10:50 AM

I think this API function should help you with your luatext :)
There are only 10 types of people... those who understand binary and those who don't.

#229 ctrlfrk

ctrlfrk

    Glass Joe

  • Members
  • 8 posts

Posted 02 August 2010 - 01:39 AM

return "AFK\n%s",AFKTIME


change that into
return "AFK\n%.2f",AFKTIME

That should display the afk time as a 'float' with only 2 decimal places.

#230 Dankz

Dankz

    Von Kaiser

  • Members
  • 58 posts

Posted 24 September 2010 - 03:04 AM

Simply trying to get KGPanels to be class colored unless the until has aggro, then red.

I'm using
local _, class = UnitClass("player");
if class 
"WARRIOR" then self:SetBackdropBorderColor(0.95, 0.23, 0.23, 0.50) elseif class
"PRIEST" then self:SetBackdropBorderColor(1, 0.96, 0.98, 0.50) elseif class
"MAGE" then self:SetBackdropBorderColor(0.00, 1, 1, 0.50) elseif class
"DRUID" then self:SetBackdropBorderColor(1, 0.49, 0.04, 0.50) elseif class
"PALADIN" then self:SetBackdropBorderColor(0.92, 0.22, 0.46, 0.50) elseif class
"HUNTER" then self:SetBackdropBorderColor(0.33, 0.86, 0.00, 0.50) elseif class
"ROGUE" then self:SetBackdropBorderColor(1, 0.94, 0.16, 0.50) elseif class
"SHAMAN" then self:SetBackdropBorderColor(0.13, 0.42, 1, 0.50) elseif class
"WARLOCK" then self:SetBackdropBorderColor(0.36, 0.18, 1, 0.50) elseif class
"DEATHKNIGHT" then self:SetBackdropBorderColor(0.77, 0.12, 0.23, 0.50) end

for the class colored, simply want to add aggro indicator to it.

#231 Noraj

Noraj

    Don Flamenco

  • Members
  • 406 posts

Posted 10 October 2010 - 05:26 PM

Simply trying to get KGPanels to be class colored unless the until has aggro, then red.

I'm using

local _, class = UnitClass("player");
if class 
"WARRIOR" then self:SetBackdropBorderColor(0.95, 0.23, 0.23, 0.50) elseif class
"PRIEST" then self:SetBackdropBorderColor(1, 0.96, 0.98, 0.50) elseif class
"MAGE" then self:SetBackdropBorderColor(0.00, 1, 1, 0.50) elseif class
"DRUID" then self:SetBackdropBorderColor(1, 0.49, 0.04, 0.50) elseif class
"PALADIN" then self:SetBackdropBorderColor(0.92, 0.22, 0.46, 0.50) elseif class
"HUNTER" then self:SetBackdropBorderColor(0.33, 0.86, 0.00, 0.50) elseif class
"ROGUE" then self:SetBackdropBorderColor(1, 0.94, 0.16, 0.50) elseif class
"SHAMAN" then self:SetBackdropBorderColor(0.13, 0.42, 1, 0.50) elseif class
"WARLOCK" then self:SetBackdropBorderColor(0.36, 0.18, 1, 0.50) elseif class
"DEATHKNIGHT" then self:SetBackdropBorderColor(0.77, 0.12, 0.23, 0.50) end

for the class colored, simply want to add aggro indicator to it.



You'll likely want to use UnitThreatSituation (API UnitThreatSituation - WoWWiki - Your guide to the World of Warcraft) to accomplish this. It should be as easy as adding another IF case before any of the class coloring -- IF the unit has aggro, color it red, ELSE check what class it is.

Skip using the second argument for UnitThreatSituation since you want to check for any aggro, instead of aggro of a specific unit.
"The question is not how far we are going to take it... the question is, do you possess the constitution to go as far as needed?" - Il Duce

#232 shaak

shaak

    Glass Joe

  • Members
  • 2 posts

Posted 13 October 2010 - 05:34 PM

Is it possible to just show the level of something.
The same way "[Level: DifficultyColor]" did with dogtags.

#233 fyritke

fyritke

    Glass Joe

  • Members
  • 10 posts

Posted 17 October 2010 - 10:33 PM

delete, figured it out

#234 Koreos

Koreos

    Glass Joe

  • Members
  • 2 posts

Posted 22 October 2010 - 11:18 PM

I am having difficulty trying to print the name of my target's owner (in case my target is a pet). What is the UnitId for it? Right now I have:

if IsPet() then
return '%s',Name(unit)
end

Which just prints the pet's name.

#235 FrabjousNight

FrabjousNight

    Glass Joe

  • Members
  • 1 posts

Posted 16 March 2011 - 06:17 AM

Hi there. Just before my WoW subscription ended, I put together a very large LuaText to display multiple auras, with animated timer bars, on PitBull4 unit frames. The bottom line of this image shows the default layout of the text for a resto druid, showing Swiftmend, Wild Growth, Rejuvenation, Regrowth, and Lifebloom. (There are defaults for all classes, both healer-oriented and dps-oriented)
Posted Image

The project page (link to curseforge) contains a few animations showing the text in action.

If you give this a try, please post your thoughts at the project page.

The LuaText is so huge that it's inconvenient to edit. If several people express interest, I may be able to resubscribe for a bit and restructure the code as an addon you can call from a short LuaText.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users