Just trying to create a reeaaaally simple addon, but I can't get the slash commands to work. When I try them ingame, I just get the "Type '/help' for a listing of a few commands." message as if they don't exist.
Code:
RegisterAddonMessagePrefix("adry")
SLASH_ADRY1 = '/adry';
local function handler(msg, editbox)
SendAddonMessage("adry", msg, "PARTY" );
end
SlashCmdList["ADRY"] = handler;
local adryFrame = CreateFrame("FRAME");
adryFrame:RegisterEvent("CHAT_MSG_ADDON");
local function eventHandler(self, event, ...)
prefix, msg, type, player = ...;
if prefix == 'adry' then
if msg == 'dmg' then
PlaySoundFile("Interface\\AddOns\\Adry\\big_damage.mp3")
else if msg == 'cc' then
PlaySoundFile("Interface\\AddOns\\Adry\\CCing.mp3")
else if msg == 'monk' then
PlaySoundFile("Interface\\AddOns\\Adry\\monk.mp3")
else if msg == 'chaim' then
PlaySoundFile("Interface\\AddOns\\Adry\\chaim.mp3")
end
end
end
adryFrame:SetScript("OnEvent", eventHandler);