This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Recording kicks and bans.

Old posts that have not been replied to for several years.
Locked
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Recording kicks and bans.

Post by Skipper »

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
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

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?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try it and see.

PS: use code tags and use

Code: Select all

if {![channel get $chan kick]} {return 0}
instead of lsearching it.
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

Code: Select all


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.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

maintaining a separate logfile for kickbans only is absolutely pointless, eggdrop already logs those for you, simply search through the bot's logfile(s)
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

Hello,

Can someone help me to complete this tcl? :)


Rgds

Skipper
Locked