View Single Post
03-18-09, 11:49 AM   #926
Lysiander
An Aku'mai Servant
Join Date: Dec 2007
Posts: 37
Hi there,

im having trouble with some of my Tags not updating properly and was hoping someone could enlighten me. Essentially, I have written tags that check the player for certain raidbuffs and show a reminder if one is missing. (The concept is that if there is someone in the raid who should be buffing you, but isn't, the tag will tell you.)
It all works fine and dandy, however, the updates only occur when a unit aura changes, despite the fact that I have also listed
RAID_ROSTER_UPDATE
PARTY_MEMBERS_CHANGED
as events for the tag. Code is a bit cluttered, but it should be readable:

Code:
	local function isRaid()
		if GetNumRaidMembers() > 0 then return true else return false end
	end
	
	local function classcount(buffclass)
		local count = 0
			for i = 1, GetNumRaidMembers() do
				_, _, _, _, _, fileName, zone, online = GetRaidRosterInfo(i)
				if fileName == buffclass and online == 1 then count = count +1 end
			end
			if class == buffclass then count = count -1 end
			return count
	end
	
	local function bos(buffclass)
		local count = classcount(buffclass)
			for i = 1,40 do
				name = UnitAura('player', i, 'HELP')
				if name == 'Greater Blessing of Sanctuary' then count = count -1 else end
			end
		return count
	end
Code:
 
oUF.Tags['[PalaB2]'] = function(u) if isRaid() then
    if bos('PALADIN') >= 2 then 
	if class == 'DRUID' then
	if (not UnitAura(u, 'Blessing of Might') and not UnitAura(u, 'Greater Blessing of Might')) then return 'BoM' else return '' end
	else 
	if (not UnitAura(u, 'Blessing of Wisdom') and not UnitAura(u, 'Greater Blessing of Wisdom')) then return 'BoW' else return '' end
	end
	end
	end
end
Code:
	oUF.TagEvents['[PalaB2]'] = 'UNIT_AURA RAID_ROSTER_UPDATE PARTY_MEMBERS_CHANGED'
This is only one example tag. It does work fine, it just doesn't update when someone leaves the raid, joins the raid or goes linkdead, which is rather important to me. Anyone got any pointers?