Hmm .. not sure why but none of my debug prints are showing at all.
I have this code in place and I get none of the messages appearing.
Lua Code:
local guildie={}
local f=CreateFrame("Frame")
f:RegisterEvent("GUILD_ROSTER_UPDATE")
f:RegisterEvent("NAME_PLATE_UNIT_ADDED")
f:SetScript("OnEvent",function(self,event,unit)
print(event,unit)
if event=="GUILD_ROSTER_UPDATE" then
local total=GetNumGuildMembers()
wipe(guildie)
for i=1,total do
local guid=select(17,GetGuildRosterInfo(i))
local localizedClass, englishClass, localizedRace, englishRace, sex, name, realm = GetPlayerInfoByGUID(guid)
print(i,unit,name,englishClass,englishRace,realm)
if guid then
guildie[guid]=true
end
end
elseif event=="NAME_PLATE_UNIT_ADDED" then
local guid = UnitGUID(unit)
local localizedClass, englishClass, localizedRace, englishRace, sex, name, realm = GetPlayerInfoByGUID(guid)
print(unit,name,englishClass,englishRace,realm)
if guildie[guid] then
Playsound(416)
end
end
end)
Nevermind .. I forgot to add the lua file to the toc file .. newbie mistake *slaps head*
Now that I have that minor thing working rofl. I am getting nameplateadded event triggering with a parameter of nameplate1 or nameplate2 with 4 players being referenced by them as they appear and then disappear and are recycled.
Now to test the guildie part of the equation with my lowbie free account character.