| View previous topic :: View next topic |
| Author |
Message |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Fri Aug 26, 2005 7:22 am Post subject: Recording kicks and bans. |
|
|
Hello Ppl,
Is it possible to record the kicks and bans to a file.. and getting the infos via IRC.. when we type !banfind .. where the bot will gives info in the channel.. abt who kicked/banned the user and for what reason.
Rgds
Skipper |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Fri Aug 26, 2005 7:46 am Post subject: |
|
|
set logging dir "~/eggdrop/logs"
setudef flag kick
logging binds
bind kick - * log:kick
proc log:kick {nick host hand chan targ text} {
global logdir
if {[lsearch -exact [channel info $chan] +kick] == -1} {return 0}
set logstr "\[[strftime %H:%M]\] *** $targ was kicked by $nick ($text)"
set addlog [open $logdir/[string range [string tolower $chan] 1 end].log a]
puts $addlog "$logstr"
close $addlog
}
Will This Help? or am i wrong here? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Aug 26, 2005 8:01 am Post subject: |
|
|
Try it and see.
PS: use code tags and use
| Code: | | if {![channel get $chan kick]} {return 0} |
instead of lsearching it. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Fri Aug 26, 2005 10:10 am Post subject: |
|
|
| Code: |
set logging dir "~/eggdrop/logs"
set logchan "#test"
logging binds
bind kick - * log:kick
bind mode - "* +b" log:mode
proc log:kick {nick host hand chan targ text} {
global logdir
if {![channel get $logchan kick]} {return 0}
set logstr "\[[strftime %H:%M]\] *** $targ was kicked by $nick ($text)"
set addlog [open $logdir/[string range [string tolower $chan] 1 end].log a]
puts $addlog "$logstr"
close $addlog
}
proc log:mode {nick uhost hand chan chag vict} {
global logdir
if {![channel get $logchan mode]} {return 0}
set logstr "\[[strftime %H:%M]\] *** $nick sets mode: $chag $vict"
set addlog [open $logdir/[string range [string tolower $chan] 1 end].log a]
puts $addlog "$logstr"
close $addlog
}
|
I used logchan coz.. i dont want to log all the channels.. thats why used for specific channels.
Is it correct? And if its correct .. let me know how to find the bans from the file.. when i type !banfind nick. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Aug 26, 2005 1:42 pm Post subject: |
|
|
| maintaining a separate logfile for kickbans only is absolutely pointless, eggdrop already logs those for you, simply search through the bot's logfile(s) |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Sat Aug 27, 2005 8:11 am Post subject: |
|
|
Hello,
Can someone help me to complete this tcl?
Rgds
Skipper |
|
| Back to top |
|
 |
|