Hello. I want to request a tcl script if possible.
I want a script to log all the public commands ex ( ! . ) in my channel when a user give a command !blabla or .blabla to log it in a txt and if its possible ( if ) to sent it in a specific email.
DragnLord wrote:This will place public commands starting with "!" or "." in the bot's log file (also shows on partyline with the correct console flags).
set logfile "/home/blabla/public_html/bot.log"
bind pubm - "% !*" cmd:log
bind pubm - "% .*" cmd:log
proc cmd:log {n u h c t} {
set cmdlog [open ${::logfile} a+]
set timestamp [clock format [clock seconds]]
puts $cmdlog "\[$timestamp\] $t used by $n in $c"
close $cmdlog
}
set logfile "/home/blabla/public_html/bot.log"
bind pubm - "% !*" cmd:log
bind pubm - "% .*" cmd:log
proc cmd:log {n u h c t} {
set cmdlog [open ${::logfile} a+]
set timestamp [clock format [clock seconds]]
puts $cmdlog "\[$timestamp\] $t used by $n in $c"
close $cmdlog
}
This should be what you're looking for.
I just change the logfile from config to the public_html and works fine
thank u very much DragnLord