View Single Post
03-22-13, 11:48 AM   #9
tednik
An Aku'mai Servant
 
tednik's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 33
Originally Posted by Phanx View Post
He wants something that will alert him when someone talks in General chat saying Sha/Galleon/whatever is up.

Okay, ChatAlerts looks pretty useless then... why would you write a chat alert addon that can't actually monitor the channels that are hardest to monitor on your own?

Anyway, this will monitor numbered channels for messages containing "sha" or "galleon" and re-print those messages to the UIErrorsFrame. Should work unless ElvUI is breaking the UIErrorsFrame, though that wouldn't surprise me, since ElvUI seems to break everything and be imcompatible with everything and its author refuses to fix any and all compatibility issues.

Code:
local words = { -- MUST BE LOWERCASE
    "sha",
    "galleon",
}
ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", function(_, _, message, _, _, _, _, _, channelID)
    if channelID == 0 or type(channelID) ~= "number" then return end -- ignore custom channels
    local lowermessage = strlower(message)
    for i = 1, #words do
        if strfind(lowermessage, words[i]) then
            UIErrorsFrame:AddMessage(message, 1, 0.75, 0.75)
        end
    end
end)
Use http://addon.ziuo.net/ to turn it into an addon if you don't know how.
Thank you very much for the code i will use it till i can find something or i can get someone to code something more to suit my needs

Originally Posted by Torhal View Post
I have several channels all in their own tab. The default UI only flashes the whisper tab when it has activity. Pretty simple reasoning, I think.
Maybe Torhal can add this option in to his ChatAlerts if i ask him nicely

Last edited by tednik : 03-22-13 at 11:50 AM. Reason: added
  Reply With Quote