Thread Tools Display Modes
05-05-09, 04:44 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Raid indicators with tag events

Is it only possible to use the tag system for font strings or can we even use it for textures?

I finally got my heal druid to 80 and had some problems tracking my hots in raids.

p3lim posted a nice idea for tracking mark of the wild on another thread that got me thinking. What I finally want is 4 indicators in the 4 edges of my raidframe, indicating each druid hot. Regrowth, Rejuventation, Lifebloom and Wildgrowth.

What I am asking myself: Is it possible to apply tag-events to textures or frames aswell, or is it fontstring only? Fontstring only I guess.

Idea with using fontstring
Code:
oUF.Tags["[checkreju]"] = function(unit) 
  if UnitAura(unit, "Rejuvenation", "HELPFUL|PLAYER") then
    return "r"
  else
    return ""
  end
end
oUF.TagEvents["[checkreju]"] = "UNIT_AURA"

local RejuIndicator = SetFontString(self.Health, d3font, 16, "THINOUTLINE")
RejuIndicator:SetPoint("TOPLEFT",3,-3)
self:Tag(RejuIndicator, "[checkreju]")
I dont know if this condition does work though:
Code:
if UnitAura(unit, "Rejuvenation", "HELPFUL|PLAYER") then
I mean when I try adding a filter.

Whats kind of disturbing is that the documentation says that http://www.wowwiki.com/API_UnitAura needs a unit and the "index" of the buff/debuff. But is does seem to work by using the spellname aswell.

What I am kind of afraid is the sheer number of UNIT_AURA events in raids.

The problem with this is, that if I have 4 different indicators with 4 different events I think its 4x the load as if I would anchor the UNIT_AURA event to self myself and create a custom function that tries to find the buffs on the player.

I don't know whats faster: UnitAura(unit, "Rejuvenation", "HELPFUL|PLAYER") or going through 1,40 buffs each UNIT_AURA checking for the 4 possible buffs.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 05-05-09 at 05:02 AM.
  Reply With Quote
05-05-09, 08:10 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
I use the following to check if the unit has Gift/Mark of the Wild on them in my raid layout (oUF Mini)

Code:
local gift, mark = GetSpellInfo(21849), GetSpellInfo(1126)

oUF.Tags['[misswild]'] = function(u) return (not UnitAura(u, gift) and not UnitAura(u, mark)) and '|cffff33ff!|r' end
oUF.TagEvents['[misswild]'] = 'UNIT_AURA'
and dont return an empty string, it messes up the tag system

Last edited by p3lim : 05-05-09 at 08:13 AM.
  Reply With Quote
05-05-09, 09:09 AM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Yes, I know how you implemented Mark of the wild, but does this work when trying to add filters aswell? That's the question I had!

Code:
local spell = GetSpellInfo(spellid)
local filter = "HELPFUL|player"
if UnitAura(u, spell, filter) then
 ...
end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
05-05-09, 09:19 AM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by zork View Post
Yes, I know how you implemented Mark of the wild, but does this work when trying to add filters aswell? That's the question I had!

Code:
local spell = GetSpellInfo(spellid)
local filter = "HELPFUL|player"
if UnitAura(u, spell, filter) then
 ...
end
Try it? (too short)
  Reply With Quote
05-05-09, 11:23 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
local reju, regrowth, lifebloom, wildgrowth = GetSpellInfo(48440), GetSpellInfo(48443), GetSpellInfo(48450), GetSpellInfo(53249)

Doesn't work for me:
Code:
  oUF.Tags['[checkreju]'] = function(u) 
    local filter = "HELPFUL|PLAYER"
    if UnitAura(u, reju, filter) then
      return "#"
    else
      return "~"
    end
  end
  oUF.TagEvents['[checkreju]'] = 'UNIT_AURA'
Works:
Code:
  oUF.Tags['[checkreju]'] = function(u) 
    local filter = "HELPFUL|PLAYER"
    if UnitAura(u, reju) then
      return "#"
    else
      return "~"
    end
  end
  oUF.TagEvents['[checkreju]'] = 'UNIT_AURA'
So either I am using the filter wrong or filtering just does not work in combination with the name. Tried any combination of the filter. None does work.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
05-05-09, 12:30 PM   #6
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
from wowwiki
This parameter can be any of "HELPFUL", "HARMFUL", "PLAYER", "RAID", "CANCELABLE", "NOT_CANCELABLE". You can also specify several filters separated by a | or space character to chain multiple filters together (e.g. "HELPFUL|RAID" or "HELPFUL RAID" == helpful buffs that you can cast on your raid). By default UnitAura has "HELPFUL" as an implicit filter - you cannot get back BOTH helpful and harmful at the same time. Neither "HELPFUL" or "HARMFUL" have meaning for UnitBuff/UnitDebuff, and will be ignored.
Use 'PLAYER', not 'HELPFUL|PLAYER'
  Reply With Quote
05-05-09, 04:42 PM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Yeah, I had tried PLAYER aswell. Doesn't work. Was just an idea, I am going to use oUF_AuraWatch anyway.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
05-05-09, 08:32 PM   #8
nushkah
A Murloc Raider
Join Date: Apr 2009
Posts: 4
Something like
Code:
oUF.Tags['[rejuv]'] = function(u)
   local fromwho = select(8, UnitAura(u, 'Rejuvination'))
   if (fromwho == 'player') then
      return UnitAura(u, 'Rejuvination') and '#'
   end
end
oUF.TagEvents['[rejuv]'] = 'UNIT_AURA'
should work just fine for what you want it to do.

Last edited by nushkah : 05-05-09 at 08:44 PM.
  Reply With Quote
05-05-09, 10:28 PM   #9
Tekkub
A Molten Giant
 
Tekkub's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 960
Look at the custom aura tags in oUF_tek.

ANd yes, you can embed the raid icons in strings. http://www.wowwiki.com/UI_Escape_Sequences
__________________
I have reached enlightment.
Thank you bacon!
  Reply With Quote
05-06-09, 02:32 AM   #10
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Thanks. Any clue what happens if more than one Rejuvenation is on the mob?

select(8, UnitAura(u, 'Rejuvination')) delivers "PLAYER" and or something else, depending on caster. The function is called on the UNIT_AURA event, what I am asking myself is: if two buffs of rejuvenation (or something else tracked) are on the mob, now lets assume that the rejuventation of my raidparty member is lower on the index as my rejuvenation, does it stop on the first match of UnitAura(u, 'Rejuvination')? Tricky...
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
05-06-09, 06:44 AM   #11
nushkah
A Murloc Raider
Join Date: Apr 2009
Posts: 4
Originally Posted by zork View Post
Thanks. Any clue what happens if more than one Rejuvenation is on the mob?

select(8, UnitAura(u, 'Rejuvination')) delivers "PLAYER" and or something else, depending on caster. The function is called on the UNIT_AURA event, what I am asking myself is: if two buffs of rejuvenation (or something else tracked) are on the mob, now lets assume that the rejuventation of my raidparty member is lower on the index as my rejuvenation, does it stop on the first match of UnitAura(u, 'Rejuvination')? Tricky...
From wowwiki:
UNIT_AURA:
Fired when a buff, debuff, status, or item bonus was gained by or faded from a player, pet, NPC, or mob.
From this information I'm going to make the assumption that since the event is fired for each aura individually, it calls the function for each individually. With this in mind it probably isn't a bad idea to add a couple of lines though they aren't necessary by any means.

Code:
oUF.Tags['[rejuv]'] = function(u)
   local name = UnitAura(u, 'Rejuvenation')
   local fromwho = select(8, UnitAura(u, 'Rejuvenation'))
   if (name == 'Rejuvenation') then
      if (fromwho == 'player') then
         return UnitAura(u, 'Rejuvenation') and '#'
      end
   end
end
oUF.TagEvents['[rejuv]'] = 'UNIT_AURA'

Last edited by nushkah : 05-06-09 at 07:19 AM. Reason: fixed spelling
  Reply With Quote
05-14-09, 12:59 PM   #12
wannad00it
A Murloc Raider
 
wannad00it's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jun 2008
Posts: 7
Hijacking your thread <3

lol not really hijacking it, but I'm thinking this falls under the same category


Im using Maneut's raidframes. well kinda,but I really stole the corner indicators that he stole from freeb.

http://pastebin.com/m605111e1

Heres my problem, for the life of me i cant get WS or weakened soul to show up no matter what i try. Im guessing his aurafunc doesnt include debuffs. However i cant figure it out.

any help would be simply amazing.
  Reply With Quote
05-14-09, 03:27 PM   #13
nushkah
A Murloc Raider
Join Date: Apr 2009
Posts: 4
Code:
oUF.Tags['[ws]'] = function(u) if UnitDebuff(u, 6788, true) then return '|cff990000.|r' end end
The only problem I see with this code is the 3rd argument of UnitDebuff is removable and unless I'm mistaken the debuff you want information for isn't removable. This should work:
Code:
oUF.Tags['[ws]'] = function(u) if UnitDebuff(u, 6788) then return '|cff990000.|r' end end
The only thing I changed was removing true from UnitDebuff. This indicator should show on anyone who has the debuff regardless of who put it there.

The reason that the rest of the code works is it is run through aurafunc and the 3rd argument to that is whether it was cast by the player or not.

Last edited by nushkah : 05-14-09 at 04:12 PM.
  Reply With Quote
05-14-09, 06:29 PM   #14
wannad00it
A Murloc Raider
 
wannad00it's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jun 2008
Posts: 7
hmm tried it out. and it made sense but didnt end up working. i tried it with unit debuff and aurafunc. do i need to run debuffs through a seperate function from aurafunc?
  Reply With Quote
05-15-09, 03:49 AM   #15
nushkah
A Murloc Raider
Join Date: Apr 2009
Posts: 4
Found the problem. When dealing with UnitBuff, UnitDebuff, and UnitAura you have to use the specified spell's name or which buff/debuff slot it is taking. You can't use spellids.
Either of these will work:
Code:
oUF.Tags['[ws]'] = function(u)
   return UnitDebuff(u, 'Weakened Soul') and '|cff990000.|r'
end
Code:
oUF.Tags['[ws]'] = function(u)
   if UnitDebuff(u, 'Weakened Soul') then return '|cff990000.|r' end
end
They are both exactly the same as far as execution goes.
  Reply With Quote
05-15-09, 11:21 AM   #16
wannad00it
A Murloc Raider
 
wannad00it's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jun 2008
Posts: 7
worked perfectly! thanks much
  Reply With Quote
05-18-09, 03:12 AM   #17
Lysiander
An Aku'mai Servant
Join Date: Dec 2007
Posts: 37
You can use SpellIds indirectly by using:
Code:
 UnitAura('unit', GetSpellInfo(6788))
GetSpellInfo() returns the Spells Name referenced by the ID as it's first argument.
  Reply With Quote
05-19-09, 08:11 AM   #18
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Lysiander View Post
You can use SpellIds indirectly by using:
Code:
 UnitAura('unit', GetSpellInfo(6788))
GetSpellInfo() returns the Spells Name referenced by the ID as it's first argument.
Don't use the GetSpellInfo() function right inside the tag, make a local of it
  Reply With Quote
05-20-09, 03:32 AM   #19
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
P3lim is right on this one. You need the spellname only once at loadup and not everytime you ask for UnitAura.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
05-20-09, 05:44 AM   #20
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Originally Posted by zork View Post
P3lim is right on this one. You need the spellname only once at loadup and not everytime you ask for UnitAura.
Considering the tag might be scanned every time somebody gets a buff/debuff, it will fire a lot. Comparing versus a string is faster then comparing versus a function call like this, in most cases.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Raid indicators with tag events


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