WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   AddMessage (https://www.wowinterface.com/forums/showthread.php?t=34379)

weasoug 08-09-10 11:37 AM

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

Slakah 08-09-10 11:39 AM

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()

weasoug 08-09-10 12:08 PM

Quote:

Originally Posted by Slakah (Post 201782)
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

Slakah 08-09-10 12:17 PM

Quote:

Originally Posted by weasoug (Post 201785)
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")

weasoug 08-09-10 12:35 PM

Quote:

Originally Posted by Slakah (Post 201787)
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()


All times are GMT -6. The time now is 05:23 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI