View Single Post
05-02-21, 11:27 AM   #13
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
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:
  1. local guildie={}
  2. local f=CreateFrame("Frame")
  3. f:RegisterEvent("GUILD_ROSTER_UPDATE")
  4. f:RegisterEvent("NAME_PLATE_UNIT_ADDED")
  5. f:SetScript("OnEvent",function(self,event,unit)
  6.     print(event,unit)
  7.     if event=="GUILD_ROSTER_UPDATE" then
  8.         local total=GetNumGuildMembers()
  9.         wipe(guildie)
  10.         for i=1,total do
  11.             local guid=select(17,GetGuildRosterInfo(i))
  12.             local localizedClass, englishClass, localizedRace, englishRace, sex, name, realm = GetPlayerInfoByGUID(guid)
  13.             print(i,unit,name,englishClass,englishRace,realm)
  14.             if guid then
  15.                 guildie[guid]=true
  16.             end
  17.         end
  18.     elseif event=="NAME_PLATE_UNIT_ADDED" then
  19.         local guid = UnitGUID(unit)
  20.         local localizedClass, englishClass, localizedRace, englishRace, sex, name, realm = GetPlayerInfoByGUID(guid)
  21.         print(unit,name,englishClass,englishRace,realm)
  22.         if guildie[guid] then
  23.             Playsound(416)
  24.         end
  25.     end
  26. 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.
__________________

Last edited by Xrystal : 05-02-21 at 11:35 AM.
  Reply With Quote