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

Capturing shouts via GMCP?

ZbacoZbaco Posts: 93Member ✭✭✭ - Distinguished
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

  • JacenJacen Posts: 2,269Member @@ - 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
    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 StormPosts: 2,630Member @@ - 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."
    SolnirDairon
  • TahquilTahquil Posts: 3,790Member @@ - 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 Posts: 1,004Member @ - Epic Achaean
    @Jacen is this something that ansi2decho() can help with btw?
  • JacenJacen Posts: 2,269Member @@ - Legendary Achaean
    Vadimuses said:
    @Jacen is this something that ansi2decho() can help with btw?
    Very much so, didn't know that existed! Thanks!
    image
Sign In to Comment.