Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-02-14, 11:15 PM   #1
Anneeta
A Defias Bandit
Join Date: Apr 2014
Posts: 2
Help with slash command

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);
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Help with slash command


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