Help Index :: Misc :: GMCP.Channels

GMCP.Channels

All major channels should be present in GMCP. Each Channels object (like
GMCP.Channels.OOC) will contain the immediate last message sent on that
channel.

For example, when you receive a tell GMCP data will also be sent for that
tell:

gmcp.Channels.Tell = {
message = "hello there",
direction = "received",
sequence = 8638,
who = "Pato",
when = "Wed Oct 28 11:56",
language = ""
}

The intention is that players will use GMCP event handlers to do something with the channel data.

The following is an example specific to Mudlet but could be adapted to other
clients. Consider the following registered to gmcp.Channels.Tell:

function channel_tell()
local buf = ""
if gmcp.Channels.Tell.direction == "sent" then
buf = "[You >> "..gmcp.Channels.Tell.who.."] "
else
buf = "["..gmcp.Channels.Tell.who.."] "
end
buf = buf .. gmcp.Channels.Tell.message
cecho( "chattab3", ""..buf.."\n" )
end

This will result in your 'chattab3' receiving tells as you receive them in
game. (tabs in this example came from the basic trigger set on the TFE web site)

Channels other than tell are a bit simpler:

function channel_gtell()
cecho( "chattab5", "["..gmcp.Channels.Gtell.who.."] "..gmcp.Channels.Gtell.message.."\n" )
end

You can tell the mud to send your entire tell history using:

sendGMCP("Channels.Tell")

This could be used to populate your chat tabs initially when starting the
client. The intention is to call this once, not to use this for polling.
(You would instead to receive tells as they arrive through events as mentioned
above)

See also: 'help GMCP'