Hail, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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

Capturing shouts via GMCP?

ZbacoZbaco Member Posts: 157 ✭✭✭ - 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 Member Posts: 2,302 @@ - 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 StormMember Posts: 2,983 @@ - 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 Member Posts: 4,011 @@ - 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,083 @ - Epic Achaean
    @Jacen is this something that ansi2decho() can help with btw?
  • JacenJacen Member Posts: 2,302 @@ - 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.