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: Select all
10/08/22 14:49:52 CMSG #CHANNELLOG: user(user@12.12.12.12) 12this is CTRL+K+12
Code: Select all
10/08/22 14:49:52 CMSG #CHANNELLOG: user(user@12.12.12.12) this is CTRL+K+12
Code: Select all
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"