Thread: Double Events
View Single Post
03-07-10, 04:09 PM   #13
Zinc
A Deviate Faerie Dragon
Join Date: Mar 2010
Posts: 13
Alright, I set it to display the second argument, but it is displaying CHAT_MSG_CHANNEL_JOIN anyway. The second argument is the joining player, according to the wowwiki article.

"CHAT_MSG_CHANNEL_JOIN"

Fired when someone joins a chat channel you are in

arg1
seems to be empty
arg2
Name of the player that joined
arg3
seems to be empty again
arg4
Number and name of the channel (e.g. "5. MyOwnChannel")
arg8
Channel number
arg9
channel name without number (this is sometimes in lowercase)
.lua
Code:
  local frame = CreateFrame("FRAME", "MParent");
  frame:RegisterEvent("CHAT_MSG_CHANNEL_JOIN");

  local function autoResponse(empty,joiner,emptyb,channel,number,nonmember)
    print("|CFF00FF00" .. joiner .. " has entered the channel.|R");
  end

  frame:SetScript("OnEvent",autoResponse);
Also, once I get the name instead of the.. whatever that is, can I just do this? Let's say I set the argument for the player's name to pname.
Code:
/script SendChatMessage("Welcome!" ,"WHISPER" ,nil ,pname);
Edit: Are all variables in lua global?

Last edited by Zinc : 03-07-10 at 04:21 PM.
  Reply With Quote