Chat windows and 'say'

I've been trying to do this...

<p>if gmcp.Comm.Channel.Text.channel == "says" then</p><p>		demonnic.chat:append("All")</p><p>end</p>


but it just puts a prompt in my chat window.

Is there an easy way to get this working..?
beep

Comments

  • I do something similar, but I capture the text itself with this:

    local txt = string.match(gmcp.Comm.Channel.Text.text,[[^%W%[.+%d+m(.+)"%W%[.+%d+m$]])

    then you can use the above with whatever script to echo into your chatbox.  It only bugs out if people right something with digits and letters mixed in the say.
    Take great care of yourselves and each other.
  • Ciaran said:
    I do something similar, but I capture the text itself with this:

    local txt = string.match(gmcp.Comm.Channel.Text.text,[[^%W%[.+%d+m(.+)"%W%[.+%d+m$]])

    then you can use the above with whatever script to echo into your chatbox.  It only bugs out if people right something with digits and letters mixed in the say.
    Well... I'm not sure how to send text to the demonnic chat thingy. I've only used and seen it use the append thing...
    beep
  • Based on some googlefu I think it would be something like: 
     demonnic.chat.windows["All"]:echo(txt)
    Take great care of yourselves and each other.
  • Ciaran said:
    Based on some googlefu I think it would be something like: 
     demonnic.chat.windows["All"]:echo(txt)

    This got me halfway there, but...



    Then I get this jumble of symbols
    ...I guess this is probably why you had that match pattern?

    But, hm, it would be nice to keep added emotes and stuff if possible...
    beep
  • You have other options, like using color triggers etc.

    You'll want to adjust the txt match pattern.  It never occured to me, but perhaps different characters receive different prefixes/suffixes.  That pattern I gave you above works perfectly for me, so it's a bit strange that it doesn't for you.

    Can you post a copy of what your 'gmcp.Comm.Channel.Text.text' looks like exactly?
    Take great care of yourselves and each other.
  • Oh, it's not that the pattern doesn't work.. I'm just trying to keep it as 'broad' as possible?

    But this is what it looks like...
     

    A color trigger was how I tried to do it the first time but... since mudlet only gives you those basic 16 colors for it, it's... hard to not have overlap...

    (This does seem like something that should be simple, but it's so hard to do in a complete and thorough way...)
    beep
  • Well, you know you can change the colors of says so if that's what you'd prefer to use, you can sync it up to be pretty unique.

    Otherwise I'd recommend using my filter to get rid of the prefix and suffix, and just echo that.

    Good luck!
    Take great care of yourselves and each other.
  • edited August 2017
    Yehn said:
    Ciaran said:
    Based on some googlefu I think it would be something like: 
     demonnic.chat.windows["All"]:echo(txt)

    This got me halfway there, but...



    Then I get this jumble of symbols
    ...I guess this is probably why you had that match pattern?

    But, hm, it would be nice to keep added emotes and stuff if possible...

    @Yehn That jumble of characters is the ANSI color information. Among other reasons I'm sure, Lusternia sends it to 1.) make it easy to trigger off colors and 2.) make it easy for us to preserve color data. Looking very briefly at the demonic function append, it uses the Mudelt function appendBuffer() to print to the miniconsole. Assuming that bit of code from earlier still works, try modifying it to include the Mudlet function ansi2decho() like so:
    demonnic.chat.windows["All"]:echo(ansi2decho(txt))

    Not using demonic, it's hard for me to test this, but the Mudlet documentation says appendBuffer() handles "rich text" so I think this will help.
  • Ciaran said:
    Well, you know you can change the colors of says so if that's what you'd prefer to use, you can sync it up to be pretty unique.

    Otherwise I'd recommend using my filter to get rid of the prefix and suffix, and just echo that.

    Good luck!

    The problem with colors is some things can't be changed, like NSTAT or those OOC tips... But!

    I tried your filter and it seems to work fine even with numbers and stuff thrown in?

    Chirbi said:
    Yehn said:
    Ciaran said:
    Based on some googlefu I think it would be something like: 
     demonnic.chat.windows["All"]:echo(txt)

    This got me halfway there, but...



    Then I get this jumble of symbols
    ...I guess this is probably why you had that match pattern?

    But, hm, it would be nice to keep added emotes and stuff if possible...

    @Yehn That jumble of characters is the ANSI color information. Among other reasons I'm sure, Lusternia sends it to 1.) make it easy to trigger off colors and 2.) make it easy for us to preserve color data. Looking very briefly at the demonic function append, it uses the Mudelt function appendBuffer() to print to the miniconsole. Assuming that bit of code from earlier still works, try modifying it to include the Mudlet function ansi2decho() like so:
    demonnic.chat.windows["All"]:echo(ansi2decho(txt))

    Not using demonic, it's hard for me to test this, but the Mudlet documentation says appendBuffer() handles "rich text" so I think this will help.

    Oh ok. For now I just used Ciaran's filter and stuck in a <cyan> tag... but I'll keep this in mind if I run into any quirks and want to try another way.
    beep
  • And thanks for all the help with this. say in chat window at last!
    beep
Sign In or Register to comment.