Thread Tools Display Modes
04-14-11, 07:16 AM   #1
Talisia
A Deviate Faerie Dragon
Join Date: Sep 2007
Posts: 15
Pitbull & Lua - Weakened Soul

Hello =)

I have a peice of lua code for my pitbull frames which shows me as a healer my important buffs etc. I am absolutely rubbish with Lua and picked the code up somewhere on the web (Ty!). I have been trying to incorporate the Weakened Soul Debuff but I just can not get it to work =(

I have hit a dead end and for the life of me can not work it out and I was hoping some nice person browsing this forum may be able to shed some light on it for me and put me out of my misery! Being a disc priest I have to see this debuff!

This is my code:

local text = ""
local count

if UnitAura(unit, "Renew") ~= nil then
text = text .. format("|cffffff00%s|r", " R ")
end

if UnitAura(unit, "Fear Ward") ~= nil then
text = text .. format("|cff00ff00%s|r","FW ")
end

if UnitAura(unit, "Prayer of Mending") ~= nil then
text = text .. format("%s","PoM ")
end

if UnitAura(unit, "Power Word: Shield") ~= nil then
text = text .. format("|cffffff00%s|r","PW:S ")
end

if UnitAura(unit, "Pain Suppression") ~= nil then
text = text .. format("|cff00ff00%s|r","PS ")
end

if UnitAura(unit, "Soulstone Resurrection") ~= nil then
text = text .. format("|cff00ff00%s|r","SS ")
end

if UnitAura(unit, "Beacon of Light") ~= nil then
text = text .. format("|cff00ff00%s|r","BoL ")
end

if UnitAura(unit, "Hand of Protection") ~= nil then
text = text .. format("|cff00ff00%s|r","HoP ")
end

if UnitAura(unit, "Lifebloom ") ~= nil then
_,_,_,count = UnitAura(unit, "Lifebloom")
text = text .. format("|cffffff00%s|r[%d]","LB",count)
end

return text

Any help offered I sincerely appreciate! =)
  Reply With Quote
04-14-11, 09:34 AM   #2
Terranell
Premium Member
Premium Member
Join Date: Apr 2006
Posts: 52
I've got a similar set up with lua texts though I really need to tidy it up. I found that Weakened Soul had to have UnitAura(unit,i,"HARMFUL") to work, without the "HARMFUL" I couldn't get it to show. But that's with a disclaimer that I only dabble at the edges of lua, tweaking my local copies of addons to suit me, and don't know that much about it.
  Reply With Quote
04-14-11, 09:53 AM   #3
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
"Weakened Soul" is actually a debuff, so Terranell is absolutely right, you'll have to add the "HARMFUL"-flag, because without it, "HELPFUL" is implicitly set.
__________________
  Reply With Quote
04-14-11, 11:25 AM   #4
Talisia
A Deviate Faerie Dragon
Join Date: Sep 2007
Posts: 15
Hiya and ty for the replies! =)

Regarding 'Harmful' that is the information I found when googling, but no matter how I put it in (copying pieces of code here and there) it just would never work =(

Mostly what I had was something like this:

if UnitAura(unit, "Weakened Soul") ~= nil "Harmful" then
text = text .. format("|cffffff00%s|r", "WS")
end

Again, I really have no idea what im doing when it comes to Lua I just love to tinker with it
  Reply With Quote
04-14-11, 11:45 AM   #5
Terranell
Premium Member
Premium Member
Join Date: Apr 2006
Posts: 52
Have you tried

if UnitAura(unit, "Weakened Soul","HARMFUL") ~= nil then
text = text .. format("|cffffff00%s|r", "WS")
end

As a side note, can anyone explain what the benefits are to ~= nil over == true in terms of checking auras?
  Reply With Quote
04-14-11, 12:07 PM   #6
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
It should work with

lua Code:
  1. if ( UnitAura(unit, "Weakened Soul","HARMFUL") ) then
  2.      text = text .. format("|cffffff00%s|r", "WS")
  3. end

Originally Posted by Terranell View Post
As a side note, can anyone explain what the benefits are to ~= nil over == true in terms of checking auras?
UnitAura does not return a boolean - true/false - value, but

name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId
= UnitAura("unit", index or "name"[, "rank"[, "filter"]])
So you can not check for true, because it doesn't return true in its first return value (it's the name).
But a name - a string to be specific - is something different than "nil", so you can check if it is not nil.
__________________
  Reply With Quote
04-14-11, 03:48 PM   #7
Terranell
Premium Member
Premium Member
Join Date: Apr 2006
Posts: 52
ahh thanks
  Reply With Quote
04-14-11, 11:07 PM   #8
Talisia
A Deviate Faerie Dragon
Join Date: Sep 2007
Posts: 15
Still not working, ty both for your help! I copied and pasted both of your codes but nope nothing =( I just cant see what im doing wrong, everything else shows up fine, its just the Weakened Soul.

I really want to find an answer to this as mentioned im a disc priest so its just not something I can do without!

Ty again
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Pitbull & Lua - Weakened Soul

Thread Tools
Display Modes

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