• 0

    posted a message on How to hook message from chat?
    Button:RegisterEvent("CHAT_MSG_GUILD")
    Button:RegisterEvent("CHAT_MSG_OFFICER")
    Button:RegisterEvent("CHAT_MSG_BATTLEGROUND")
    Button:RegisterEvent("CHAT_MSG_BATTLEGROUND_LEADER")
    Button:RegisterEvent("CHAT_MSG_PARTY")
    Button:RegisterEvent("CHAT_MSG_RAID_LEADER")
    Button:RegisterEvent("CHAT_MSG_RAID")
    Button:RegisterEvent("CHAT_MSG_WHISPER")
    Button:RegisterEvent("CHAT_MSG_BN_WHISPER")
    Button:RegisterEvent("CHAT_MSG_CHANNEL")
    Button:RegisterEvent("CHAT_MSG_SAY")
    
    Button:SetScript("OnEvent", function(self, event, msg, sender, _, chanString, _, _, _, chanNumber, chanName)
        if message ~= nil then
        local mas = {"!mop","!mists","!pandaria","!panda"}
           for i=1,#mas do
               local startPos, endPos = string.find(msg,mas[i]);
               if startPos ~= nil then 
                 if string.sub(msg,startPos,endPos) == mas[i] then 
                    if chanNumber > 0 then SendChatMessage(Report,"CHANNEL",nil,chanNumber) else SendChatMessage(Report,"GUILD") 
                   end
                 end
               end 
             end


    I try to use this and can hook/send message to any channel, but I don't know how to distinguish message from SAY from message of GUILD
    Posted in: Need Help?
  • 0

    posted a message on How to hook message from chat?
    Quote from Farmbuyer
    Those are generated from different events. For example, CHAT_MSG_GUILD fires for messages to /g, CHAT_MSG_RAID and CHAT_MSG_RAID_LEADER for messages to /ra (depending on who is typing the message), and so forth.

    CHAT_MSG_CHANNEL is for the numbered channels, like General or channels you've joined by typing /join.

    The same handler function can be used for all of those events, simply be careful how you're treating the event parameters ("arg1", etc).


    I try to use they, but after
    RegisterEvent("CHAT_MSG_GUILD")

    "channelString", channelNumber, "channelName" returns nil and nothing :(
    Posted in: Need Help?
  • 0

    posted a message on How to hook message from chat?
    Quote from Goranaws
    First you would need to create a frame to handle the necessary code:
    local frame = CreateFrame("Frame", "MyFrameName")
    


    Then you set the frame to register the event called "CHAT_MSG_CHANNEL". This will allow you to retrieve the information you want.

    frame:RegisterEvent("CHAT_MSG_CHANNEL")
    


    Once you have registered the event, you can set your frame to receive the script:

    frame:SetScript("OnEvent", function(self, event, arg1, arg2, arg3, arg4, arg5, ...)
         --your code inside goes here.
    end)
    



    You can get more info from here: http://www.wowpedia.org/Events/Communication
    Look for the event called "CHAT_MSG_CHANNEL"


    Very big thanks!
    I can get name of channel (trade, lfg, general), but I can't get name of guild, party, raid, say (recieving nil from channelString, channelNumber, channelName). How to get them?
    Posted in: Need Help?
  • 0

    posted a message on How to hook message from chat?
    Anybody writes message to chat, for example:

    [Guild][Name]: chatmessage

    How I can hook message text, sender name and channel name from chat?

    Thanks!
    P.S.: sorry for my english, it's very bad :(
    Posted in: Need Help?
  • 0

    posted a message on How to create own icon?
    I want to create an icon and use it in my plugin for Titan Panel.
    I have tried to create a 16x16 or 24x24 pixels, use TGA or BLP format.
    And the result is a blank space or a green square instead of icons.
    How can I create an icon, what format and what size?
    Thanks!
    Posted in: AddOn HELP!
  • 0

    posted a message on How to create a countdown timer?
    This is what I needed. Thank you!

    Sorry, how as of 10 dec 2010 subtract the current date 11 jul 2010 ( date() )?
    Posted in: Ace3
  • 0

    posted a message on How to create a countdown timer?
    There is a certain date (eg December 31, 2010), how to use Ace3 create countdown timer which will show the remaining time until the New Year?
    It's necessary to show the months, days, hours, minutes and required seconds

    I novice in addons creating, and sorry me for my english.

    Thanks
    Posted in: Ace3
  • To post a comment, please or register a new account.