Thread: realid aiv
View Single Post
12-13-10, 07:33 AM   #5
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 127
i have been trying to cut it down. and this is what i have. no errors. but not tested.

any help would be good.

Code:
local function IsFriend(name)
	for i=1,GetNumFriends() do if GetFriendInfo(i) == name then return true end end
        for i=1,GetRealmName() do if BNGetFriendToonInfo(i) == name then return true end end
	if IsInGuild() then for i=1, GetNumGuildMembers() do if GetGuildRosterInfo(i) == name then return true end end end
end


local f = CreateFrame("Frame")
f:RegisterEvent("PARTY_INVITE_REQUEST")
f:SetScript("OnEvent", function(frame, event, name)
	if IsFriend(name) then
		for i=1,STATICPOPUP_NUMDIALOGS do
			local frame = getglobal("StaticPopup"..i)
			if frame:IsVisible() and frame.which == "PARTY_INVITE" then StaticPopup_OnClick(frame, 1) end
		end
	else SendWho(string.join("", "n-\"", name, "\"")) end
end)
__________________
wMmap :: Is a lightweight Minimap, with a sleek look & custom imagery.
wIn1 :: In one addon. and is very lightweight & simple to use.
wChat :: Is a lightweight chat mod.
wBroker :: Is A simple broker add-on.
wPetXPBar :: Is A simple lightweight Pet XP Bar.
wBuffs :: Is A simple Buffs Bar.
  Reply With Quote