egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Recording kicks and bans.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
Skipper
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Fri Aug 26, 2005 7:22 am    Post subject: Recording kicks and bans. Reply with quote

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
View user's profile Send private message
Skipper
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Fri Aug 26, 2005 7:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Aug 26, 2005 8:01 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Skipper
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Fri Aug 26, 2005 10:10 am    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Aug 26, 2005 1:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Skipper
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Sat Aug 27, 2005 8:11 am    Post subject: Reply with quote

Hello,

Can someone help me to complete this tcl? Smile


Rgds

Skipper
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber