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 

Ban + html generating

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
hellrazor
Voice


Joined: 30 Nov 2006
Posts: 3

PostPosted: Thu Nov 30, 2006 10:01 pm    Post subject: Ban + html generating Reply with quote

Hello there Smile First of all, I am not very good at tcl coding. I need tcl like .. hmm KillLog, but instead of loggin kills, to log the kicks and bans. I mean - when someone get kicked from my channel, the bot should log the nick who was kicked, the nick who kicked (and the hosts of both) and the reason for kicks. After that, it should generate a webpage with .. with the same information. If there is .. someone who could write suck a think (because i can't) please, share your knowledge with me Smile
Thanks in advance!
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Dec 03, 2006 1:59 am    Post subject: Reply with quote

Code:

bind kick - * logit
bind mode - "* +b" logit

proc logit {nick uhost hand chan arg1 arg2} {
       if {$arg1 == "+b"} {
                set line "<pre>BAN: Set by $nick ($hand - $uhost) on channel $chan against $arg2 </pre>"
       } else {
                set line "<pre>KICK: Set by $nick ($hand - $uhost) on channel $chan against $arg1 for $arg2 </pre>"
       }
       set kickbanlog [open /path/to/my/kickban.log a]
       puts $kickbanlog $line
       catch {close $kickbanlog}
}
#antiwordwrap#########################################################################################################

Should work, not tested..Obviously doesn't have the html header (which probably won't be necessary anyway.) That gives you the basics, modify to suit.
Back to top
View user's profile Send private message
hellrazor
Voice


Joined: 30 Nov 2006
Posts: 3

PostPosted: Sun Dec 03, 2006 7:17 am    Post subject: Reply with quote

Thanks, it works Smile One more thing, can it log the date and the time?
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Dec 03, 2006 4:04 pm    Post subject: Reply with quote

Sure, just add [ctime [unixtime]] into the 'set line' parts:

set line "<pre>BAN: [ctime [unixtime]] and so forth"
Back to top
View user's profile Send private message
hellrazor
Voice


Joined: 30 Nov 2006
Posts: 3

PostPosted: Sun Dec 03, 2006 6:03 pm    Post subject: Reply with quote

Everything works okay .. but there is one more thing, it logs bans only from one channel. Is there anyway to log from 2 or more channels? Btw, thanks a lot for the tcl. Now we can control much better the spam/invite from one ip/host.
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Dec 03, 2006 6:39 pm    Post subject: Reply with quote

It should log all channels, hence the * in the bind (read the documentation for bind)
Back to top
View user's profile Send private message
tisho
Voice


Joined: 15 Feb 2007
Posts: 3

PostPosted: Tue Mar 06, 2007 5:21 am    Post subject: Thanks to rosc2112 for the idea ! Reply with quote

Code:

# ============================================================================
# KickBanLog.tcl v1.0 (12/Feb/2007) by Yxaaaaaaa & Tisho & Thanks  to rosc2112
# -------------- COPYRIGHT C.LEONHARDT 2007 --------------------
# Original concept by rosc2112 (C.LEONHARDT)
# http://forum.egghelp.org/viewtopic.php?p=68656#68656
#
# Description:
# This tcl logs every Kick & Ban in chosen channel, and generates html file)
#
# Yxaaaaaaa UniBG @ #EggFAQ ( http://www.egghlep-bg.com )
# Tisho UniBG @ #DJ ( http://DjTisho.com )
# (Please e-mail us your suggestions and bugs - djtisho|at|gmail.com
# ============================================================================

# Starting configuration ...

# Channels (separated by space)
set kbechans "#channel1 #channel2"

# Main log dir (full path to your logs dir, e.g. /home/user/public_html/log )
set kbepath "/home/user/public_html/log"

# Setting the HTTP charset parameter ( http://www.w3.org/International/O-HTTP-charset )
set charset "windows-1251"

# Binds
bind kick - * e:log
bind mode - "* +b" e:log

# Start tcl script - DO NOT change anything below !
proc e:createpage c {
    if {![string match *$c* $::kbechans]} {return}
      set efile "$::kbepath/$c/index.html"
      set fid [open $efile w]
    puts $fid "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$::charset\" />\n
    <body text=\"#FFFFFF\" bgcolor=\"#000000\" topmargin=\"0\" leftmargin=\"0\">\n
    <p align=\"center\"><u><font size=\"5\" face=\"Verdana\">Channel #$c Kicks &amp; Bans log</font></u></p>\n"
    close $fid
    }
    proc e:log {n u h c w t} {
      set c [string map [list "#" {}] [string tolower $c]]
    if {![file isdir $::kbepath/$c]} { catch {[file mkdir $::kbepath/$c]}}
      set efile "$::kbepath/$c/index.html"
    if {![file exists $efile]} { e:createpage $c}
    if {$w == "+b"} {
 set line "<pre><font color='green'>BAN: [ctime [unixtime]] Set by $n ($h - $u) on channel #$c against $t</font></pre>"
    } else {
  set line "<pre><font color='red'><u>KICK:</u> [ctime [unixtime]] Set by $n ($h - $u) on channel #$c against $w for <u>$t</u> </font></pre>"
     }
      set kickbanlog [open $efile a]
     puts $kickbanlog $line
   catch {close $kickbanlog}
     }

# putlog
putlog "KickBanLog.tcl v1.0 by <\002Yxaaaaaaa & Tisho & rosc2112\002> Loaded."
Back to top
View user's profile Send private message
m4s
Voice


Joined: 30 Jan 2017
Posts: 24

PostPosted: Tue May 02, 2017 11:08 am    Post subject: Reply with quote

rosc2112 wrote:
Code:

bind kick - * logit
bind mode - "* +b" logit

proc logit {nick uhost hand chan arg1 arg2} {
       if {$arg1 == "+b"} {
                set line "<pre>BAN: Set by $nick ($hand - $uhost) on channel $chan against $arg2 </pre>"
       } else {
                set line "<pre>KICK: Set by $nick ($hand - $uhost) on channel $chan against $arg1 for $arg2 </pre>"
       }
       set kickbanlog [open /path/to/my/kickban.log a]
       puts $kickbanlog $line
       catch {close $kickbanlog}
}
#antiwordwrap#########################################################################################################

Should work, not tested..Obviously doesn't have the html header (which probably won't be necessary anyway.) That gives you the basics, modify to suit.


Hello to everyone!

I would like to ask someone to modify this scripts for me.
I would like to store the "-b" actions too. It is good to know who removed the ban and when.

Thanks for your help! Smile
Back to top
View user's profile Send private message
dreamwatcher
Voice


Joined: 20 Jul 2017
Posts: 1

PostPosted: Thu Jul 20, 2017 1:40 pm    Post subject: Hope to get a reply Reply with quote

Well supposing with this script lets modify it.

The eggdrop bot logs each kick and ban in channel 1. Channel 1 is the main channel. Channel 2 is the help channel for channel 1. The user came to channel 2 but the person who kicked is not there. As an operator i want to help.

So i type !searchban nick
the bot replies.

Searching for ban report on $nick in channel 1 ...
Ban Found on $nick with ban mask $banmask
Reason: $kickreason Placed By: $kick-maker Date & Time: $date $time

Please help me on this. would be very greatful. should reply on help channel on mains only. i'll add the colours myself. thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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