Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Events:CHAT_MSG_CHANNEL
- --Trigger
- function(event, msg, author, _, _, _, _, _, _, channel)
- --Raid Notification Weak Aura
- --Author: Krazyito - Mal'ganis - US
- --Takes text in specificed channel to alert player someone wants them to use their cooldown.
- --Text syntax: "PlayerName, Spellid"
- --Edit the channel name below and in 'Actions' for custom channel
- --Version 2.0
- --Changes:
- --1.1: Got support from ERT.
- --1.2: Some support for single target CDs, the tank that wants it needs to click the spell himself (from ERT) for it to show up with his name. (first version bugged)
- --1.3: Fixed single target section. Now when a single target cooldown is sent by it player, the name of the person who sent the aura will appear.
- --1.3.1: fixed bug where channel name would be case sensetive.
- --2.0: Cleaned A LOT OF CODE. Got rid of the table I had originally made to save the icons I wanted to use. Instead, just use a function to look up the icon. Broke single target fix.
- if event == "CHAT_MSG_CHANNEL" and string.upper(channel) == string.upper("SRCDS") then -- if something is said in this channel -- EDIT THIS CHANNEL NAME
- local stringTable = aura_env.DoSplit(msg, ", ") --parse the string into a table
- if stringTable[1] == aura_env.playerName then -- if the playername is mentioned
- aura_env.sender = string.gsub(author, "%-[^|]+", "") -- store the name of the person who sent the command and remove their realm name.
- aura_env.ouputIcon = select (3, GetSpellInfo(tonumber(stringTable[2]))) -- Save the icon information. (3rd parameter of GetSpellInfo
- return true
- end
- end
- return false
- end
- --Display
- function()
- if aura_env.ouputIcon then
- return "USE |T" .. aura_env.ouputIcon ..":16|t" -- show icon
- else
- return "Nothing? - report bug"
- end
- end
- --On Init
- local split = function (msg, inSplitPattern, outResults ) -- string parser
- if not outResults then
- outResults = { }
- end
- local theStart = 1
- local theSplitStart, theSplitEnd = string.find(msg, inSplitPattern, theStart )
- while theSplitStart do
- table.insert( outResults, string.sub(msg, theStart, theSplitStart-1 ) )
- theStart = theSplitEnd + 1
- theSplitStart, theSplitEnd = string.find(msg, inSplitPattern, theStart )
- end
- table.insert( outResults, string.sub(msg, theStart ) )
- return outResults
- end
- aura_env.DoSplit = split -- save the above function as a global to this aura
- aura_env.playerName = UnitName("player") -- get the current player name
- aura_env.ouputIcon = "init"
- aura_env.sender = "init"
- --custom code by ERT author
- local function SpecialClick(data)
- local chat,channel={GetChannelList()}
- for i=1,#chat,2 do
- if string.upper(chat[i+1]) == string.upper("SRCDS") then -- EDIT THE CHANNEL NAME
- channel=chat[i]
- break
- end
- end
- if not channel then return end
- SendChatMessage(data.name..", "..data.db[1],"CHANNEL",nil,channel)
- end
- if _G.GExRT and _G.GExRT.A.ExCD2 then
- _G.GExRT.A.ExCD2.db.plugin.UpdateRoster=function(line) line.specialClick=SpecialClick end
- end
- -------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement