EVENT CHAT MESSAGE CHANNEL

From ESOUI Wiki

Jump to: navigation, search

Adding what I figured out for others.

Start the event listener.

EVENT_MANAGER:RegisterForEvent(Addon.name, EVENT_CHAT_MESSAGE_CHANNEL, Addon.functiontodostuff)

End the event listener when not needed

EVENT_MANAGER:UnregisterForEvent(Addon.name, EVENT_CHAT_MESSAGE_CHANNEL)


function Addon.functiontodostuff(event, channelType, fromName, messageText, isCustomerService, fromDisplayName)

 -- function to do stuff when chat message has been recieved.
 -- here is the message format from wiki
 --EVENT_CHAT_MESSAGE_CHANNEL (number eventCode, MsgChannelType channelType, string fromName, string text, boolean isCustomerService, string fromDisplayName)
 -- fromName is the charactername
 -- fromDisplayName is the @playername
 -- see the global constants for channelType.
 -- note that CHAT_CHANNEL_PARTY is the group chat
 -- CHAT_CHANNEL_SAY is the say channel
 -- With the message received you can parse out the information that you wish to share.
 CODE TO DO WHAT YOU WANT

end


When you want to post to the chat system the simplest way, only way I figured out is:

CHAT_SYSTEM.textEntry:InsertLink("/* ".."Your Message Here")

Note that the * in /* very simply directs the message to the appropriate channel.

IE /s to post to Say; /g to post to group; etc. Note that there is a space after the *. Without the space the message loses its channel.

Very important is that this ONLY forms the chat message for you. It does NOT send it. The player still needs to press enter to send the message. This avoids unwanted robospam.

--Hochbrawn 22:01, 26 April 2020 (UTC)

Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox