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.
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...
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?
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...)
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:
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:
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.
Comments
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.
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...
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?
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...)
Otherwise I'd recommend using my filter to get rid of the prefix and suffix, and just echo that.
Good luck!
@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:
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.
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?
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.