View previous topic :: View next topic |
Author |
Message |
cnecrea Voice
Joined: 08 Oct 2022 Posts: 3
|
Posted: Sat Oct 08, 2022 9:07 am Post subject: Need help to remove color codes |
|
|
hi there,
Can someone help me with this part of TCL? It is supposed to log all chat lines and actions (/me or /ame) to a file. The "problem" is that when someone writes with color code (CTRL+K) or BOLD/Underline also logs it and I don't want that.
CTRL+K+12 example
Code: |
10/08/22 14:49:52 CMSG #CHANNELLOG: user(user@12.12.12.12) 12this is CTRL+K+12
|
example what I want without inserting "12" or similar (strip codes)
Code: |
10/08/22 14:49:52 CMSG #CHANNELLOG: user(user@12.12.12.12) this is CTRL+K+12
|
Code: | setudef flag chat
set logfile "logs/"
bind pubm - * spymsgecho
proc spymsgecho { nick uhost h chan text } {
if {[channel get $chan chat]} {
global logfile
set r "[open "$logfile/$chan.log.log" a+]"
puts $r "[strftime "%D %T"] CMSG $chan: $nick ($uhost) $text";
close $r
}
}
bind ctcp - action spyactionecho
proc spyactionecho {nick uhost h d k text} {
global botnick
if {$d == $botnick} {
return 0
} elseif {[lsearch -exact [channel info $d] {+chat}] != "-1"} {
global logfile
set r "[open "$logfile/$d.log.log" a+]"
puts $r "[strftime "%D %T"] AMSG $d: $nick ($uhost) $text";
close $r
}
}
putlog "TCL LOG"
|
Any help would be a great help, thanks!!! |
|
Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1074 Location: France
|
|
Back to top |
|
 |
cnecrea Voice
Joined: 08 Oct 2022 Posts: 3
|
Posted: Sat Oct 08, 2022 5:59 pm Post subject: |
|
|
Many thanks!!! Worked! |
|
Back to top |
|
 |
|