Thread: Double Events
View Single Post
03-07-10, 12:04 AM   #1
Zinc
A Deviate Faerie Dragon
Join Date: Mar 2010
Posts: 13
Double Events

Alright, I`m no stranger to coding, but I`m a bit new to WoW API Lua. So, for my first challenge, I`m making a chat bot. So, I decided to make it have a welcoming message. This is what I had so far.

Code:
  local frame = CreateFrame("FRAME", "MParent");
  frame:RegisterEvent("CHAT_MSG_CHANNEL_JOIN");

  local function autoResponse()
    print("|CFF00FF00Someone has entered the channel.|R");
  end

  frame:SetScript("OnEvent",autoResponse);
However, it is firing the event twice each time someone joins the channel, so it says:

Someone has entered the channel.
Someone has entered the channel.
  Reply With Quote