Capturing shouts via GMCP?

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.)?

Comments

  • 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
    end
    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
    end
    That's the basics of it, anyways.
    image
  • KlendathuKlendathu Eye of the Storm
    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."
  • 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).
  • @Jacen is this something that ansi2decho() can help with btw?
  • Vadimuses said:
    @Jacen is this something that ansi2decho() can help with btw?
    Very much so, didn't know that existed! Thanks!
    image
Sign In or Register to comment.