I have an addon and one thing it does is check to see if my public note has changed and if so change it back, the only way I can think to do this is register guild roster update event and check every time it fires
I'm curious if there isn't a better way to do it that is neater here's what I have, which works fine
Lua Code:
if event=="GUILD_ROSTER_UPDATE" then
local pt = {"Spawnova", "Shin"}
for i=1 , GetNumGuildMembers() do --loop through all
local name,_,_,_,_,_,Note=GetGuildRosterInfo(i) --get name at index
for _, value in pairs(pt) do --test name for any in list
if name==value and Note~=SGDB[name].note then --if contains name and note is not saved note
GuildRosterSetPublicNote(i,SGDB[name].note) --change back to old note
end
end
end
end
I'm always trying to learn new/better ways to do thing if anyone sees anything that could be more effecient let me know!