This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Need to strip color and underline codes out of log files

General support and discussion of Eggdrop bots.
Post Reply
d
davidc1857
Voice
Posts: 1
Joined: Mon Feb 12, 2007 12:47 am

Need to strip color and underline codes out of log files

Post by davidc1857 »

I'm basically trying to use eggdrop for nothing more than creating good readable logs for a IRC channel.

I've got it working the way I want, except that a lot of people use colors and such and those codes show up in the log as control characters, etc.

Is there an easy way to strip those out?

Thanks,
David Chamberlian
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

You'll have to make a little custom script/proc for logging things, and then pass the input through the [stripcodes] function:
stripcodes <strip-flags> <string>
Description: strips specified control characters from the string given.
strip-flags can be any combination of the following:
b - remove all boldface codes
c - remove all color codes
r - remove all reverse video codes
u - remove all underline codes
a - remove all ANSI codes
g - remove all ctrl-g (bell) codes
Returns: the stripped string.
Module: core
Post Reply