This post is in response to the following conversation on #egghelp @ freenode.
<AlphaTech> In the built-in logs how can I disable color? It making funky logs on my logging webpage
<SpiKe^^> not sure if there's a better way, but you could try a little proc i have used to remove all colorcodes from everything the bot sees
<SpiKe^^> but it will affect everything the bot sees, not just the logging stuff
catch {unbind raw - PRIVMSG *raw:irc:msg}
bind raw - PRIVMSG striprivmsg
proc striprivmsg {f k a} {
set a [string map [list \017 ""] [stripcodes abcgru $a]]
*raw:irc:msg $f $k $a
}
This is what BogusTrivia uses to make binds trigger on text that contains control codes.
This code is adapted from an old egghelp.org forum post @ http://forum.egghelp.org/viewtopic.php?t=12944
Please let me know if this helps, AlphaTech.
This is a revised version of that same proc.
1. As of eggdrop 1.6.21, [stripcodes abcgru $string] does not strip the control code \017, an issue thommey is aware of.
2. For most uses, the "unbind raw - PRIVMSG *raw:PRIVMSG" is not needed.
3. This is a complete example of that proc, with the unbind in a catch, to keep it from killing the bot on rehash.
Thanks for pointing out the prior post I already did though.
oh euhm yea thanks CC i posted this before i found out i had controlstrip module loaded on znc thats why i couldnt see any color codes after unloading it all was fine.
SpiKe^^ wrote:This post is in response to the following conversation on #egghelp @ freenode.
<AlphaTech> In the built-in logs how can I disable color? It making funky logs on my logging webpage
<SpiKe^^> not sure if there's a better way, but you could try a little proc i have used to remove all colorcodes from everything the bot sees
<SpiKe^^> but it will affect everything the bot sees, not just the logging stuff
catch {unbind raw - PRIVMSG *raw:irc:msg}
bind raw - PRIVMSG striprivmsg
proc striprivmsg {f k a} {
set a [string map [list \017 ""] [stripcodes abcgru $a]]
*raw:irc:msg $f $k $a
}
This is what BogusTrivia uses to make binds trigger on text that contains control codes.
This code is adapted from an old egghelp.org forum post @ http://forum.egghelp.org/viewtopic.php?t=12944
Please let me know if this helps, AlphaTech.
that code doesn't work with utf-8 especially emojis
Let's see if I explain myself better XD, using eggdrop with utf-8 "emojis" when using !Say 😀 the bot copies the message well using emojis, but by adding this code, it kills the emojis when using !Say 😀 sends signs