Quantcast
AddMessage - WoWInterface
Thread Tools Display Modes
08-09-10, 11:37 AM   #1
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 128
Post AddMessage

hi all. i wanted to ask if there is some other way to use DEFAULT_CHAT_FRAME:AddMessage.

i know

Code:
DEFAULT_CHAT_FRAME:AddMessage(wname.." pinged by: |cffFF0000" .. ping_name .. "|r")

and will say it in the main chat window

i then found print and made it shorter in words hehe. but did the same

print(wname.." pinged by: |cffFF0000" .. ping_name .. "|r")


but can i send it to say combat channel. or minimap.

so it gets me thinknig maybe there are other
calls. like
DEFAULT_CHAT_FRAME
that i could use.


thanks for your time
  Reply With Quote
08-09-10, 11:39 AM   #2
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
ChatFrames are numbered 1-6 (iirc it might be different now). Anyway you can send a message to the CombatChatFrame (usually the second chat frame) using the function call:
ChatFrame2:AddMessage()
  Reply With Quote
08-09-10, 12:08 PM   #3
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 128
Post

Originally Posted by Slakah View Post
ChatFrames are numbered 1-6 (iirc it might be different now). Anyway you can send a message to the CombatChatFrame (usually the second chat frame) using the function call:
ChatFrame2:AddMessage()
Code:
wmpingnotice = true
Code:
wmping:RegisterEvent("MINIMAP_PING")
wmping:SetScript("OnEvent", function(self,event,unit) 
if wmpingnotice then local ping_name = UnitName(unit) 
function call:ChatFrame2:AddMessage(wname.." pinged by: |cffFF0000" .. ping_name .. "|r") end end)
is what i tryed but with no luck
  Reply With Quote
08-09-10, 12:17 PM   #4
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by weasoug View Post
Code:
wmpingnotice = true
Code:
wmping:RegisterEvent("MINIMAP_PING")
wmping:SetScript("OnEvent", function(self,event,unit) 
if wmpingnotice then local ping_name = UnitName(unit) 
function call:ChatFrame2:AddMessage(wname.." pinged by: |cffFF0000" .. ping_name .. "|r") end end)
is what i tryed but with no luck
you copied me wrong it should be
lua Code:
  1. ChatFrame2:AddMessage(wname.." pinged by: |cffFF0000" .. ping_name .. "|r")
not
lua Code:
  1. function call:ChatFrame2:AddMessage(wname.." pinged by: |cffFF0000" .. ping_name .. "|r")
  Reply With Quote
08-09-10, 12:35 PM   #5
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 128
Post

Originally Posted by Slakah View Post
you copied me wrong it should be
lua Code:
  1. ChatFrame2:AddMessage(wname.." pinged by: |cffFF0000" .. ping_name .. "|r")
not
lua Code:
  1. function call:ChatFrame2:AddMessage(wname.." pinged by: |cffFF0000" .. ping_name .. "|r")
i see. and that can be changed in the numbers you said on a past post. ie 1.to 10 ect.

ty again

ps. makes me think if i can make a name for it.

like

ChatFrame2:AddMessage()

to
local pop = ChatFrame2
then others can change from 2 to what chat channel they want to.


and this i will have in one long line of code. as i would change from 5 lines to one line.

pop:AddMessage()

Last edited by weasoug : 08-09-10 at 12:44 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » AddMessage

Thread Tools
Display Modes

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