View Single Post
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