Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --local addonname, namespace = ...
- local frame = CreateFrame("FRAME")
- frame:RegisterEvent("FRIENDLIST_UPDATE")
- frame:SetScript("OnEvent", function(self,event,...)
- local NumCurrentFriends = GetNumFriends()
- local CurrentFriends = {}
- for i = 1, NumCurrentFriends do
- local name = GetFriendInfo(i)
- if (name) then
- CurrentFriends[i] = name
- end
- end
- --print("fired")
- if tablenames then
- local allfound=true, itsfound,
- for j = 1, #tablenames do --getn counts all entrys ~= nil in a table
- itsfound = 0
- for i = 1, NumCurrentFriends do
- if (CurrentFriends[i] == tablenames[j]) then
- itsfound = 1
- end
- end
- if (itsfound == 0) then
- DEFAULT_CHAT_FRAME:AddMessage("|cFFFF0000Your friend "..tablenames[j].." is no longer on your friendlist.")
- allfound = false
- end
- end
- if allfound then
- DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00All your friends still exist")
- else
- DEFAULT_CHAT_FRAME:AddMessage("|cFFFF0000Some friends have been removed")
- end
- end
- --print(tablenames)
- tablenames = CurrentFriends
- tablenames.oldfriendsnum = NumCurrentFriends
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement