Thread Tools Display Modes
09-15-10, 01:00 PM   #1
sirann
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 142
Luatexts help

Lua Texts

So I've used these texts for a while (self written) on my pitbull. The idea is to show certain icons based off whether a certain buff, or one of it's many forms, is currently missing, and then disappear when the buff is applied to me.

My code is
Code:
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

It works just how I want it to, although I imagine there is a more cpu/memory efficient way to code this. Which is my purpose of this post

Is there a better way to code this, and if so, how?
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Luatexts help


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off