|
||||||
| Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding]. | ||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Newbie
Join Date: Sep 2008
Posts: 7
|
Hi.
I'm having some trouble using UnitAura checking for debuff types. Here's my code: Code:
if event == "UNIT_AURA" then
local type = UnitDebuff(unit, i)
local str
if type == "Magic" then
str = "MAGIC"
end
self.name:SetText(str)
end
Thanks. |
|
|
|
|
|
#2 |
|
Moderator
|
If they type isn't magic, then your SetText uses nil.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes". Author of Revelation, Volumizer, and many other AddOns. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2005
Posts: 63
|
Check http://wowprogramming.com/docs/api/UnitDebuff, the first return value is the debuffs name, which probably is not "Magic", and probably isn't either what you mean with type. I suppose you want the 5th return value?
|
|
|
|
|
|
#4 |
|
Amazing Member
Join Date: Dec 2006
Location: Lyon, France
Posts: 1,639
|
Code:
local type = UnitDebuff(unit, i)
__________________
Author of Squire, Inline Aura and several other addons. If you have a problem and you think the solution involves using a regular expression, then you have two problems. |
|
|
|
|
|
#5 | ||
|
Hero Member
|
Quote:
It's probably not his full code. Anywho, @OP: Quote:
__________________
Bruce Lee killed Chuck Norris! Don't call me a nerd. That is offensive to my people. My Characters (yes, I have a guild with only me in it). |
||
|
|
|
|
|
#6 |
|
Newbie
Join Date: Sep 2008
Posts: 7
|
I figured it out, thanks for your help : )
|
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
All times are GMT. The time now is 08:55 AM.
WowAce Forums








