Thread Tools Display Modes
03-14-09, 12:13 PM   #1
Clukclukboom
A Murloc Raider
 
Clukclukboom's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 6
custom emote in addon

I just recently started to make addons. i really like it. so i decided to make an addon for my boomkin. i want to map a button to do a custom emote (/e clucks.) but i cant seem to get this to work. been looking on various forums for about 3 hours now and cant get anything on this. also on kinda the same note how would i map a button to say something in a specific chat (i.e Guild chat) i tried

function Cluck_Button_OnClick()
DEFAULT_CHAT_FRAME:AddMessage("/gu cluck.")
end

but i had no success. it just says /gu cluck.

kinda at a loss for both these situations and any help would be awesome. ty in advance
  Reply With Quote
03-14-09, 01:18 PM   #2
Sekrin
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 150
The command you are after is SendChatMessage. To emote a cluck, use:

Code:
SendChatMessage("clucks!", "EMOTE")
A full description of this command can be found at http://www.wowwiki.com/API_SendChatMessage
__________________
  Reply With Quote
03-14-09, 01:28 PM   #3
Clukclukboom
A Murloc Raider
 
Clukclukboom's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 6
amazing ty much. didnt even think to do it like that. much love
  Reply With Quote
03-14-09, 02:12 PM   #4
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
You could also create a slash command http://www.wowwiki.com/Creating_a_slash_command.

So in your case you could do:

lua Code:
  1. SLASH_MYADDON1 = "/cluck"
  2. SlashCmdList.MYADDON = function()
  3.    SendChatMessage("clucks!", "EMOTE")
  4. end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » custom emote in addon


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