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.
General support and discussion of Eggdrop bots.
-
hacker
- Voice
- Posts: 1
- Joined: Mon Apr 01, 2024 2:11 am
Post
by hacker »
###########################################################
#
# KickBanLog.tcl v3.0 by Antonio/PTnet - 06 Julho 2015
# IGNORE Ops by Flag e Chanserv "Linha:"
# A v3.0 ignora os Kick's e Ban's por Flag escolhida
#
# ==========================================================
# =================#=============
#
# KickBanLog.tcl v2.0 by Antonio/PTnet - 06 Julho 2015
# IGNORE other Bot's and ChanServ
# Linha:
# if {![string equal -nocase "portugal" $n] && ![string equal -nocase "chanserv" $n]} {
#
#
#=============================================================#===#============
# 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 "#Anonymous"
# Main log dir (full path to your logs dir, e.g. /home/user/public_html/log )
set kbepath "~/eggdrops/Eggdrop/record"
# Setting the HTTP charset parameter ( http://www.w3.org/International/O-HTTP-charset )
set charset "utf-8"
set kickban_flag "T"
# 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/kickbanlog.txt"
set fid [open $efile w]
puts $fid "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"$::charset\" />\n
<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.privado.eu.org/statwww/anonymous/styles.css\" />
<body text=\"#FFFFFF\" bgcolor=\"\" topmargin=\"0\" leftmargin=\"0\">\n</body>"
close $fid
}
proc e:log {n u h c w t} {
global kickban_flag
set c [string map [list "#" {}] [string tolower $c]]
if {![string equal -nocase "chanserv" $n] && ![matchattr $n $kickban_flag] && ![matchattr $n |$kickban_flag $c]} {
if {![file isdir $::kbepath/$c]} { catch {[file mkdir $::kbepath/$c]}}
set efile "$::kbepath/$c/kickbanlog.html"
if {![file exists $efile]} { e:createpage $c}
if {$w == "+b"} {
set line "<pre><font color='green'>[ctime [unixtime]] $t was banned from #$c by $n</font></pre>"
} else {
if {![string equal -nocase "chanserv" $n] && ![matchattr $n $kickban_flag] && ![matchattr $n |$kickban_flag $c]} {
set line "<pre><font color='red'>[ctime [unixtime]] $w was kicked from #$c by $n</font></pre>"
}
}
set kickbanlog [open $efile a]
puts $kickbanlog $line
catch {close $kickbanlog}
}
}
# Flag para ver os tickets ..
set ticket_flag_ver "o"
# Flag para apagar tickets ..
set tick_flag_apagar "m"
proc pub:listticket {nick host hand chan text} {
global ticket_file ticket_flag_ver kbepath
if [matchattr $hand $ticket_flag_ver] {
if {![file exists "$::kbepath/kickbanlog.txt"]} {
set ficheiro [open "$::kbepath/$chan/kickbanlog.txt" w]; puts $ficheiro " "
close $ficheiro
putserv "privmsg $nick :\002\0034Não existem Pedidos.\0034\002"; return 0
}
set ficheiro [open $ticket_file r]
putserv "privmsg $nick :\002Sintaxe:\002"
putserv "privmsg $nick :\0034ID * Nick -> Pedido\0034"
while {![eof $ficheiro]} {
set linha "[gets $ficheiro]"
if {$linha != ""} {
set enviado 1;putserv "privmsg $nick :$linha"
}
}
if {$enviado == 1} { putserv "privmsg $nick :\002Fim dos Pedidos\002" } else { putserv "privmsg $nick : \002\0034Não existem Pedidos.\0034\002" }
} else { putserv "privmsg $nick : Acesso negado." }
}
proc pub:delticket {nick host hand chan text} {
global tickets_auxiliar ticket_file tick_flag_apagar kbepath
if [matchattr $hand $tick_flag_apagar] {
set valido 0
set id [string tolower [lindex $text 0]]
if {$id == ""} { putserv "privmsg $nick :Por favor especifique o ID do pedido a ser apagado. Obrigado."; return 0 }
if {![file exists $ticket_file]} {
set ficheiro [open "$::kbepath/$chan/kickbanlog.txt" w]; puts $ficheiro " "
close $ficheiro; putserv "privmsg $nick :O ID especificado não existe."; return 0
}
set ficheiro [open "$::kbepath/$chan/kickbanlog.txt" r]
set ficheiro_aux [open $tickets_auxiliar w]
while {![eof $ficheiro]} {
set linha "[gets $ficheiro]"
if {$linha != ""} {
set ident [lindex $linha 0]
if {$id == $ident} {
set valido 1
putserv "privmsg $nick :O pedido foi apagado."
}
if {$id != $ident} {
puts $ficheiro_aux $linha
}
}
}
close $ficheiro
close $ficheiro_aux
if {$valido == 0} {
putserv "privmsg $nick :Esse ID não existe."
file delete $tickets_auxiliar
return 0
}
file delete $ticket_file
file rename $tickets_auxiliar "$::kbepath/$chan/kickbanlog.txt"
} else { putserv "privmsg $nick :Acesso negado." }
}
# putlog
putlog "KickBanLog.tcl v3.0 by <\002Yxaaaaaaa & Tisho & rosc2112\002> and Antonio/PTnet Loaded."
-
CrazyCat
- Revered One
- Posts: 1276
- Joined: Sun Jan 13, 2002 8:00 pm
- Location: France
-
Contact:
Post
by CrazyCat »
Moderation : Thanks to use [ tcl ] and [ /tcl ] tags
Can you tell us what is the trouble ? Or show the errors you get ?