View Poll Results: Would you use my proposed addon?
Yes 1 50.00%
No 1 50.00%
Maybe 0 0%
Voters: 2. You may not vote on this poll

Thread Tools Display Modes
09-09-16, 06:02 PM   #1
joshmiller83
Premium Member
Premium Member
Join Date: Apr 2008
Posts: 12
Question [Request] Guild Alert AddOn

I am looking to see if its possible first of all and then see if there is an Author willing to tackle a hopefully smallish project/addon.

I along with several others have Chat Filtered in Tabs to make it easier to read and not have all chat in one place.

I have System Chats going to another tab and since Blizz DID NOT split Guild Logon/Logoff Alerts as well as Guild Join/Leave Messages differently than System Alerts, I miss them all.

I would like to have an Addon Filter those Specific Messages either back into a certain chat tab OR (if easier) have them appear in the Blizz Error Frame / MSBT Frames OR both! .

I would be forever grateful and happy!
  Reply With Quote
09-11-16, 01:22 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
This should work:

Code:
local DESTINATION = UIErrorsFrame

local ONLINE = ERR_FRIEND_ONLINE_SS:gsub("%%s", "(.+)"):gsub("[%[%]]", "%%%1")
local OFFLINE = ERR_FRIEND_OFFLINE_S:gsub("%%s", "(.+)")

local f = CreateFrame("Frame")
f:RegisterEvent("CHAT_MSG_SYSTEM")
f:SetScript("OnEvent", function(self, event, text)
	if text:match(ONLINE) then
		DESTINATION:AddMessage(text:gsub("%[(.-)%]", "%1"), 0.3, 1, 0.3)
	elseif text:match(OFFLINE) then
		DESTINATION:AddMessage(text, .6, .6, .6)
	end
end)
Change the first line if you want to send the messages to some other chat frame, eg. ChatFrame3

Use Vlad's addon creator tool to turn the code into an addon.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-11-16, 02:33 AM   #3
joshmiller83
Premium Member
Premium Member
Join Date: Apr 2008
Posts: 12
Question

This is awesome!

Is it possible to also see Guild Join and Guild Quit messages?

Thanks!
  Reply With Quote
09-11-16, 09:52 AM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Made some changes for joined/left guild messages, and to more easily support adding more message types:

Code:
local DESTINATION = UIErrorsFrame

local messageTypes = {
	{
		-- X has come online
		pattern = ERR_FRIEND_ONLINE_SS:gsub("%%s", "(.+)"):gsub("[%[%]]", "%%%1"),
		r = 0.3, g = 1, b = 0.3,
	},
	{
		-- X has gone online
		pattern = ERR_FRIEND_OFFLINE_S:gsub("%%s", "(.+)"),
		r = 0.6, g = 0.6, b = 0.6,
	},
	{
		-- X has joined the guild
		pattern = ERR_GUILD_JOIN_S:gsub("%%s", "(.+)"),
		r = 0.3, g = 1, b = 0.3,
	},
	{
		-- X has left the guild
		pattern = ERR_GUILD_LEAVE_S:gsub("%%s", "(.+)"),
		r = 0.6, g = 0.6, b = 0.6,
	},
}

local f = CreateFrame("Frame")
f:RegisterEvent("CHAT_MSG_SYSTEM")
f:SetScript("OnEvent", function(self, event, text)
	for i = 1, #messageTypes do
		local messageType = messageTypes[i]
		if text:match(messageType.pattern) then
			if not DESTINATION:IsMouseEnabled() then
				-- Remove link brackets if the destination frame doesn't support clicking
				text = text:gsub("%[(.-)%]", "%1")
			end
			return DESTINATION:AddMessage(text, messageType.r, messageType.g, messageType.b)
		end
	end
end)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-11-16, 01:18 PM   #5
joshmiller83
Premium Member
Premium Member
Join Date: Apr 2008
Posts: 12
Thumbs up

Wow! Thank you! You ROCK!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » [Request] Guild Alert AddOn

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off