Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DoMe = LibStub("AceAddon-3.0"):NewAddon("DoMe", "AceConsole-3.0", "AceEvent-3.0")
- function DoMe:OnInitialize()
- self:Print("OnInitialize")
- end
- DoMe:RegisterChatCommand("dm", "Slash")
- function DoMe:Slash(input)
- if (input == "?" or input == "") then
- self:Print("This addon registers incoming whisper events.")
- self:Print("Current events:")
- self:Print("followme - You follow the player who's sending whisper.")
- self:Print("leaveparty - If member of a party and you recieve this whisper, you leave the party.")
- self:Print("In order for this addon to work on both sides, it requires that both players have it.")
- end
- end
- function DoMe:OnEnable()
- self:RegisterEvent("CHAT_MSG_WHISPER")
- end
- function DoMe:CHAT_MSG_WHISPER(arg1,w,name,arg4,arg5,guid)
- if (w == "followme") then
- FollowUnit(guid)
- self:Print("Following "..name..".")
- end
- if (w == "leaveparty") then
- LeaveParty()
- self:Print("Leaving party. Requested by "..name..".")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement