| View previous topic :: View next topic |
| Author |
Message |
kitsaras Voice
Joined: 02 Feb 2006 Posts: 29
|
Posted: Wed Apr 12, 2006 6:59 am Post subject: script request if possible |
|
|
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.
Thank u. |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Wed Apr 12, 2006 12:00 pm Post subject: |
|
|
This will place public commands starting with "!" or "." in the bot's log file (also shows on partyline with the correct console flags).
| Code: |
bind pubm - "% !*" cmd:log
bind pubm - "% .*" cmd:log
proc cmd:log {n u h c t} {
putlog "Public Command Logger: $t used by $n in $c"
}
|
|
|
| Back to top |
|
 |
kitsaras Voice
Joined: 02 Feb 2006 Posts: 29
|
Posted: Wed Apr 12, 2006 2:38 pm Post subject: |
|
|
| 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).
| Code: |
bind pubm - "% !*" cmd:log
bind pubm - "% .*" cmd:log
proc cmd:log {n u h c t} {
putlog "Public Command Logger: $t used by $n in $c"
}
|
|
Works fine i check it but is there any way to change the log dir ex /home/blabla/public_html/bot.log ?
thank u. |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Wed Apr 12, 2006 3:00 pm Post subject: |
|
|
| Code: |
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. |
|
| Back to top |
|
 |
kitsaras Voice
Joined: 02 Feb 2006 Posts: 29
|
Posted: Wed Apr 12, 2006 5:55 pm Post subject: |
|
|
| DragnLord wrote: | | Code: |
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 |
|
| Back to top |
|
 |
|