Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Capturing shouts via GMCP?

ZbacoZbaco Member Posts: 307 ✭✭✭✭ - Eminent
I am running the YATCO tabbed chat package, and I'd like to be able to grab shouts and put them into a tab instead of having them displayed in my main window. Is there a way to capture them using a GMCP trigger of some sort, instead of having to try and code for every single type of shout (a weak voice shouts, so-and-so blasts from the heights of perfection, etc. etc.)?


  • JacenJacen Member Posts: 2,325 @@ - Legendary Achaean
    There is. I thought about posting my complete chatcap code, which is fully GMCP based, but looking over it its too ingrained with my GUI stuff ( It draws transparent boxes for the categories over a background images which has category text built in), so I'll offer a short explanation instead.

    First make a function to strip the ANSI color codes from the GMCP string:

    function stripControlCodes(str)
    local s = ""
    for sequence, text in string.gmatch (str, "\027%[([0-9;]+)m([^\027]+)") do
    		s = s .. text
    	end  -- for
    	return s
    Then, register a function to the event "gmcp.Comm.Channel.Start". Inside that function, (assuming we're only talking about shouts), check if the channel is shouts. If so, echo the stripped text to our custom window:
    if gmcp.Comm.Channel.Text.channel == shout then
         echo("myChatWindow", stripControlCodes(gmcp.Comm.Channel.Text.text
    That's the basics of it, anyways.
  • KlendathuKlendathu Eye of the StormMember Posts: 3,178 @@ - Legendary Achaean
    The easiest way is to colour them something distinct then capture by colour.

    Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."
  • TahquilTahquil Member Posts: 4,631 @@ - Legendary Achaean
    If you are part of the mudlet clan they have a file with GMCP comm capture for Yatco. Works for all shouts with (except Tharos for some strange reason but I think that may be fixed).
  • VadimusesVadimuses Member Posts: 1,136 @ - Epic Achaean
    @Jacen is this something that ansi2decho() can help with btw?
  • JacenJacen Member Posts: 2,325 @@ - Legendary Achaean
    Vadimuses said:
    @Jacen is this something that ansi2decho() can help with btw?
    Very much so, didn't know that existed! Thanks!
Sign In to Comment.