Browse Source

Add files via upload

Florian 8 years ago
parent
commit
b1df7f99bd

+ 117 - 0
BlackTools2.5/BlackTools/Protections/BT.antibadtext.tcl

@@ -0,0 +1,117 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+########################   ANTIBADTEXT TCL   ############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+############################# AntiColor ################################
+
+proc colortext:process {nick host hand chan arg type} {
+	global black
+if {![validchan $chan]} { return }
+if {[setting:get $chan $type]} {
+	set handle [nick2hand $nick]
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+if {[isbotnick $nick]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+switch $type {
+anticolor {
+	set textfind "\003" 
+}
+
+antibold  {
+	set textfind "\002"
+}
+
+antiunderline {
+	set textfind "\037"
+	}	
+}
+if {[string match "*$textfind*" $arg]} {
+	blacktools:banner:1 $nick [string toupper "$type"] $chan $host [get:banmethod $type $chan] [link:chan:get $chan]	
+		}
+	}	
+}
+
+proc anticolor:protect {nick host hand chan arg} {
+	colortext:process $nick $host $hand $chan $arg "anticolor"
+}
+
+proc anticolor:protect:me {nick host hand chan keyword arg} {
+	colortext:process $nick $host $hand $chan $arg "anticolor"
+}
+
+############################# AntiBold ################################
+
+proc antibold:protect {nick host hand chan arg} {
+	colortext:process $nick $host $hand $chan $arg "antibold"
+}
+
+proc antibold:protect:me {nick host hand chan keyword arg} {
+	colortext:process $nick $host $hand $chan $arg "antibold"
+}
+
+############################ AntiUnderline ###############################
+
+proc antiunderline:protect {nick host hand chan arg} {
+	colortext:process $nick $host $hand $chan $arg "antiunderline"
+}
+
+proc antiunderline:protect:me {nick host hand chan keyword arg} {
+	colortext:process $nick $host $hand $chan $arg "antiunderline"
+}
+
+############################## AntiCaps #################################
+
+proc anticaps:protect {nick host hand chan arg} {
+global black botnick
+	set handle [nick2hand $nick]
+	set found_caps 0
+if {![validchan $chan]} { return }
+if {[setting:get $chan anticaps]} {
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+if {[isbotnick $nick]} { return }
+	set caps($nick:$host) 0
+foreach word [split $arg {}] {
+if [string match \[A-Z\] $word] {
+	incr caps($nick:$host)
+	}
+}
+
+if {$caps($nick:$host) == 0} {
+  return
+}
+
+if {[string length $arg] < 20} {return}
+	set capchar [string length $arg]
+if {[expr 100 * $caps($nick:$host) / $capchar] > $black(anticapscount)} {
+	set found_caps 1
+}
+if {$found_caps == "1"} {
+	blacktools:banner:1 $nick "ANTICAPS" $chan $host [get:banmethod "anticaps" $chan] [link:chan:get $chan]	
+		}
+	}
+}
+
+proc anticaps:protect:me {nick host hand chan keyword arg} {
+	anticaps:protect $nick $host $hand $chan $arg
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 74 - 0
BlackTools2.5/BlackTools/Protections/BT.antibadword.tcl

@@ -0,0 +1,74 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+########################   ANTIBADWORD TCL   ############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc antibadword:protect {nick host hand chan arg} {
+global black botnick username
+	if {![validchan $chan]} { return }
+if {[setting:get $chan antibadword]} {
+	set handle [nick2hand $nick]
+	set found_word ""
+	set matchword ""
+	set text [split $arg]
+if {![validchan $chan]} { return }
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+if {[isbotnick $nick]} { return }
+	set check_word [check:file:word $chan $text "BADWORD"]
+if {$check_word != ""} {
+	blacktools:banner:1 $nick "ANTIBADWORD:$check_word" $chan $host [get:banmethod "antibadword" $chan] [link:chan:get $chan]
+	return
+}
+foreach antibadword [string tolower $black(antibadword)] {
+if {[string match -nocase $antibadword $text]} {
+	set found_word $antibadword
+			}
+		}
+if {$found_word != ""} {
+	blacktools:banner:1 $nick "ANTIBADWORD:$found_word" $chan $host [get:banmethod "antibadword" $chan] [link:chan:get $chan]		
+		}
+	}
+}
+
+proc antibadword:protect:me {nick host hand chan keyword arg} {
+global black
+antibadword:protect $nick $host $hand $chan $arg
+}
+
+proc badword:module {nick host hand chan arg} {
+	global black lastbind
+	set type 0
+	set chan1 "$chan"
+	set why [lindex [split $arg] 0]
+	set badw [join [lrange [split $arg] 1 end]]
+	set number [lindex [split $arg] 1]
+if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
+	set chan "$why"
+	set why [lindex [split $arg] 1]
+	set badw [join [lrange [split $arg] 2 end]]
+	set number [lindex [split $arg] 2]
+}
+	set return [blacktools:mychar $lastbind $hand]
+if {$return == "0"} {
+		return
+}
+	prot:module:process $nick $host $hand $chan $chan1 $why $badw $type $number "badword"
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 61 - 0
BlackTools2.5/BlackTools/Protections/BT.antichanflood.tcl

@@ -0,0 +1,61 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+#######################   ANTICHANFLOOD TCL   ###########################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc antifloodchan:protect {nick host hand chan arg} {
+global black
+if {![validchan $chan]} { return }
+if {[setting:get $chan antichanflood]} {
+	set handle [nick2hand $nick]
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+if {[isbotnick $nick]} { return  }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+	set getset [setting:get $chan chanflood]
+if {$getset == ""} { set getset "$black(antichanfloodrepeats)" }
+	set number [scan $getset %\[^:\]]
+	set time [scan $getset %*\[^:\]:%s]
+if {![info exists black(repeat:$host:$chan:flood)]} { 
+	set black(repeat:$host:$chan:flood) 0 
+}
+foreach tmr [utimers] {
+if {[string match "*chanflood:unset $host $chan*" [join [lindex $tmr 1]]]} {
+	killutimer [lindex $tmr 2]
+	}
+}
+	incr black(repeat:$host:$chan:flood)
+	utimer $time [list chanflood:unset $host $chan]
+if {$black(repeat:$host:$chan:flood) >= $number} {
+	blacktools:banner:1 $nick "ANTICHANFLOOD" $chan $host [get:banmethod "antichanflood" $chan] [link:chan:get $chan]
+	chanflood:unset $host $chan
+		}
+	}
+}
+
+proc antifloodchan:protect:me {nick host hand chan keyword arg} {
+	antifloodchan:protect $nick $host $hand $chan $arg
+}
+
+proc chanflood:unset {host chan} {
+	global black
+if {[info exists black(repeat:$host:$chan:flood)]} { 
+	unset black(repeat:$host:$chan:flood)
+	}
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 34 - 0
BlackTools2.5/BlackTools/Protections/BT.antictcp.tcl

@@ -0,0 +1,34 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+##########################   ANTICTCP TCL   #############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc antictcp:protect {nick host hand chan keyword arg} {
+global black botnick
+if {![validchan $chan]} { return }
+if {[setting:get $chan antictcp]} {
+	set handle [nick2hand $nick]
+if {[string equal -nocase "action" $keyword] || [string equal -nocase "chat" $keyword]} {return}
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return}
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+if {[isbotnick $nick]} { return }
+	blacktools:banner:1 $nick "ANTICTCP" $chan $host [get:banmethod "antictcp" $chan] [link:chan:get $chan]
+	}
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 63 - 0
BlackTools2.5/BlackTools/Protections/BT.antijoinflood.tcl

@@ -0,0 +1,63 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+#######################   ANTIJOINFLOOD TCL   ###########################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc joinflood:unlock {chan} {
+	global black
+	putquick "MODE $chan -$black(modes)"
+	unset black(floodjoin:on:$chan)
+}
+
+proc joinflood:protect {nick host hand chan} {
+global black
+if {[setting:get $chan antijoinflood]} {
+	set getset [setting:get $chan joinflood]
+	if {$getset == ""} { set getset $black(joinflood:protect) }
+	set number [scan $getset %\[^:\]]
+	set time [scan $getset %*\[^:\]:%s]
+	set replace(%chan%) $chan
+foreach tmr [utimers] {
+if {[string match "*black(joinflood:$chan)*" [join [lindex $tmr 1]]]} {
+	killutimer [lindex $tmr 2]
+	}
+}
+
+if {[info exists black(floodjoin:on:$chan)]} {
+	return
+}
+
+if {![info exists black(joinflood:$chan)]} { 
+	set black(joinflood:$chan) 0 
+}
+	incr black(joinflood:$chan)
+	utimer $time [list unset black(joinflood:$chan)]
+if {$black(joinflood:$chan) >= "$number"} {
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+	set black(floodjoin:on:$chan) 1
+	putquick "MODE $chan +$black(modes)" ; utimer $black(nomodetime) [list joinflood:unlock $chan]
+if {$black(fjoinhow) == "1"} {
+	set getlang [string tolower [setting:get $chan lang]]
+if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
+	set getmessage $black(say.$getlang.antijoinflood.1)
+	set message [string map [array get replace] $getmessage]
+	puthelp "NOTICE @$chan :$message"
+			}
+		}
+	}
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 39 - 0
BlackTools2.5/BlackTools/Protections/BT.antijoinpart.tcl

@@ -0,0 +1,39 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+########################   ANTIJOINPART TCL   ###########################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc antijoinpart:protect {nick host hand chan arg} {
+global black botnick
+	set handle [nick2hand $nick]
+if {![validchan $chan]} { return }
+if {[setting:get $chan antijoinpart]} {
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+if {[isbotnick $nick]} { return }
+if {[string equal -nocase $chan $botnick]} { return }
+if {[getchanjoin $nick $chan] >= [expr {[clock seconds]-$black(joinparttime)}]} {
+	blacktools:banner:1 $nick "ANTIJOINPART" $chan $host [get:banmethod "antijoinpart" $chan] [link:chan:get $chan]		
+		}
+	}
+}
+
+proc antijoinpart:protect:kick {nick host hand chan kicked reason} {
+global black botnick
+	set gethost [getchanhost $kicked $chan]
+	antijoinpart:protect $kicked $gethost $hand $chan "none"
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 42 - 0
BlackTools2.5/BlackTools/Protections/BT.antilongtext.tcl

@@ -0,0 +1,42 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+########################   ANTILONGTEXT TCL   ###########################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc antilongtext:protect {nick host hand chan arg} {
+global black botnick
+if {![validchan $chan]} { return }
+if {[setting:get $chan antilongtext]} {
+	set handle [nick2hand $nick]
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+if {[isbotnick $nick]} { return } 
+	set getlongchar [setting:get $chan antilongtextmax]
+if {$getlongchar == ""} { set getlongchar "$black(longchar)" }
+if {[string length $arg] >= $getlongchar} {
+	blacktools:banner:1  $nick "ANTILONGTEXT" $chan $host [get:banmethod "antilongtext" $chan] [link:chan:get $chan]
+		}
+	}
+}
+
+proc antilongtext:protect:me {nick host hand chan keyword arg} {
+global black
+	antilongtext:protect $nick $host $hand $chan $arg
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 34 - 0
BlackTools2.5/BlackTools/Protections/BT.antinotice.tcl

@@ -0,0 +1,34 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+#########################   ANTINOTICE TCL   ############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc antinotice:protect {nick host hand arg chan} {
+global black botnick
+if {![validchan $chan]} { return }
+if {[setting:get $chan antinotice]} {
+	set handle [nick2hand $nick]
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+if {[isbotnick $nick]} { return }
+if {[string equal -nocase $chan $botnick]} { return }
+	blacktools:banner:1 $nick "ANTINOTICE" $chan $host [get:banmethod "antinotice" $chan] [link:chan:get $chan]
+	}
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 120 - 0
BlackTools2.5/BlackTools/Protections/BT.antipub.tcl

@@ -0,0 +1,120 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+##########################   ANTIPUB TCL   ##############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc antipub:protect {nick host hand chan arg} {
+global black botnick
+	set text [color:filter [split $arg]]
+	set found_pub 0
+	set handle [nick2hand $nick]
+	set found_pub ""
+	set banword ""
+if {![validchan $chan]} { return }
+if {[setting:get $chan antipub]} {
+
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[check:except $text $chan $black(antipubword) $black(antipubexcept) "ANTIPUB-EXCEPT"] == "1"} { 
+	return
+}
+	
+foreach antipub [string tolower $black(antipubword)] {
+if {[string match -nocase $antipub $text]} {
+	set found_pub $antipub
+			}
+		}
+if {$found_pub != ""} {
+	blacktools:banner:1 $nick "ANTIPUB:$found_pub" $chan $host [get:banmethod "antipub" $chan] [link:chan:get $chan]
+		}
+	}
+}
+
+proc antipub:protect:me {nick host hand chan keyword arg} {
+global black
+	antipub:protect $nick $host $hand $chan $arg
+}
+
+proc check:except {text chan type except prot} {
+	global black
+	set text [split $text]
+	set counter_word 0
+	set counter_except 0
+	set found_it 0
+foreach w $type {
+if {[string match -nocase $w $text]} {
+	set found_it 1
+	}
+}
+if {$found_it == 0} { return }
+	
+foreach except $except {
+	set position [lsearch -exact [string tolower $text] [string tolower $except]]
+if {$position > -1} {
+	set text [lreplace $text $position $position]
+	}	
+}
+	set file [open $black(add_file) "r"]
+	set database [read -nonewline $file]
+	close $file
+	set data [split $database "\n"]
+
+foreach line $data {
+	set channel [lindex [split $line] 0]
+	set getype [lindex [split $line] 1]
+	set link [lrange [split $line] 3 end]
+	
+foreach word $text {
+if {[string equal -nocase $channel $chan] && [string equal -nocase $getype $prot] && [string match -nocase $link $word]} {
+	set position [lsearch -exact [string tolower $text] [string tolower $word]]
+if {$position > -1} {
+	set text [lreplace $text $position $position]
+			}
+		}
+	}
+}
+	
+foreach w $type {
+if {[string match -nocase $w $text]} {
+	return 0
+		}
+	}
+	return 1
+}
+
+proc antipub:module {nick host hand chan arg} {
+	global black lastbind
+	set type 0
+	set chan1 "$chan"
+	set why [lindex [split $arg] 0]
+	set except [join [lrange [split $arg] 1 end]]
+	set number [lindex [split $arg] 1]
+if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
+	set chan "$why"
+	set why [lindex [split $arg] 1]
+	set except [join [lrange [split $arg] 2 end]]
+	set number [lindex [split $arg] 2]
+}
+	set return [blacktools:mychar $lastbind $hand]
+if {$return == "0"} {
+		return
+}
+	prot:module:process $nick $host $hand $chan $chan1 $why $except $type $number "antipub"
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 71 - 0
BlackTools2.5/BlackTools/Protections/BT.antirepeat.tcl

@@ -0,0 +1,71 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+########################   ANTIREPEAT TCL   #############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc antirepeat:protect {nick host hand chan arg} {
+global black botnick
+	set arg [color:filter [join [split $arg]]]
+	set handle [nick2hand $nick]
+if {![validchan $chan]} { return }
+if {[setting:get $chan antirepeat]} {
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+if {[isbotnick $nick]} { return }
+	set repeatset [setting:get $chan antirepeat-setting]
+if {$repeatset == ""} { set repeatset "$black(antirepeat:repeats)" }
+	set number [scan $repeatset %\[^:\]]
+	set time [scan $repeatset %*\[^:\]:%s]
+foreach tmr [utimers] {
+if {[string match "*antirepeat:remove $host $chan $arg*" [join [lindex $tmr 1]]]} {
+	killutimer [lindex $tmr 2]
+	}	
+}
+
+if {![info exists black(repeat:$host:$chan:$arg)]} { 
+	set black(repeat:$host:$chan:$arg) 0 
+}
+	incr black(repeat:$host:$chan:$arg)
+	utimer $time [list antirepeat:remove $host $chan $arg]
+
+if {$black(repeat:$host:$chan:$arg) >= $number} {
+	blacktools:banner:1 $nick "ANTIREPEAT" $chan $host [get:banmethod "antirepeat" $chan] [link:chan:get $chan]
+	antirepeat:remove $host $chan $arg
+		}
+	}
+}
+
+proc antirepeat:remove {host chan arg} {
+	global black
+	
+foreach tmr [utimers] {
+if {[string match "*antirepeat:remove $host $chan $arg*" [join [lindex $tmr 1]]]} {
+	killutimer [lindex $tmr 2]
+	}	
+}
+
+if {[info exists black(repeat:$host:$chan:$arg)]} {
+	unset black(repeat:$host:$chan:$arg)
+	}
+}
+
+proc antirepeat:protect:me {nick host hand chan keyword arg} {
+	antirepeat:protect $nick $host $hand $chan $arg
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 126 - 0
BlackTools2.5/BlackTools/Protections/BT.antispam.tcl

@@ -0,0 +1,126 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+##########################   ANTISPAM TCL   #############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc antispam:protect {nick host hand arg} {
+global botnick black
+	set text [color:filter $arg]
+	set text [antispam:except $text]
+	set handle [nick2hand $nick]
+	set found_spam ""
+foreach spammer [string tolower $black(spamword)] { 
+if {[string match -nocase $spammer $text]} {
+	set found_spam $spammer
+	}
+}
+if {$found_spam == ""} { return }
+foreach chans [channels] {
+	set chan1 $chans
+if {![validchan $chans]} { return }
+if {[matchattr $handle $black(exceptflags) $chans]} { return }
+	set bl_protect [blacktools:protect $nick $chans]
+if {$bl_protect == "1"} { return }
+if {[setting:get $chans antispam]} {
+if {[onchan $nick $chans]} {
+if {![botisop $chans] && ![setting:get $chans xonly]} { return }
+if {[isbotnick $nick]} { return }
+	blacktools:banner:2 $nick "ANTISPAM:$found_spam" $chans $chan1 $host "0"
+if {[link:status $chans] == "1"} {
+	foreach c [link:chan:get $chans] {
+	blacktools:banner:2 $nick "ANTISPAM:$found_spam" $c $c $host "1"
+					}
+				}
+			}
+		}
+	}
+}
+
+proc antispam:except {text} {
+	global black botnick
+	set text [split $text]
+foreach t $text {
+if {[validchan $t] && [onchan $botnick $t] && [setting:get $t antispam]} {
+	set position [lsearch -exact [string tolower $text] [string tolower $t]]
+if {$position > -1} {
+	set text [lreplace $text $position $position]
+			}
+		}
+	}
+	return $text
+}
+
+proc antispam:protect:msg {nick host hand chan} {
+global black
+if {![validchan $chan]} { return }
+if {[setting:get $chan antispam]} {
+if {[isbotnick $nick]} { return }
+if {[info exists black(turnOnFlood:$chan)]} {
+	return
+}
+	set handle [nick2hand $nick]
+if {[setting:get $chan spamjoinmessage]} {
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+	set getmsg [setting:get $chan antispam-message]
+if {$getmsg == ""} { 
+	set getlang [string tolower [setting:get $chan lang]]
+if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
+	set getmsg $black(say.$getlang.antispam.2)
+}
+	set replace(%nick%) $nick
+	set replace(%chan%) $chan
+	set spamsg [string map [array get replace] $getmsg]
+	puthelp "PRIVMSG $nick :$spamsg"
+		} 
+	}
+}
+
+proc antispam:protect:cycle {} {
+global black
+	set channels ""
+foreach chan [channels] {
+if {![channel get $chan inactive]} {
+if {[setting:get $chan antispam]} {
+	lappend channels $chan
+			}
+		}
+	}
+if {$channels != ""} {
+	antispam:act $channels 0
+	set antispam_time [time_return_minute $black(spamcycle)]
+	timer $antispam_time antispam:protect:cycle
+	}
+}
+
+proc antispam:act {channels counter} {
+	global black
+	set chan [lindex $channels $counter]
+	set cc [expr $counter + 1]
+	set getlang [string tolower [setting:get $chan lang]]
+if {$getlang == ""} { set getlang "[string tolower $black(default_lang)]" }
+	set reason $black(say.$getlang.antispam.3)
+	set len [llength $reason] 
+    set random [expr int(rand()*$len)] 
+    set reason [lindex $reason $random] 
+	putserv "PART $chan :$reason"; putserv "JOIN $chan"
+if {[lindex $channels $cc] == ""} {
+	return
+	} else {
+	utimer 10 [list antispam:act $channels $cc]
+	}
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 71 - 0
BlackTools2.5/BlackTools/Protections/BT.badhost.tcl

@@ -0,0 +1,71 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+##########################   BADHOST TCL   ##############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc badhost:protect {nick host hand chan} {
+global black botnick
+	set handle [nick2hand $nick]
+	set uhost [lindex [split $host @] 1]
+	set chan1 $chan
+	set found_bad ""
+if {![validchan $chan]} { return }
+if {[setting:get $chan badhost]} {
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+	set check_word [check:file:word $chan $host "BADHOST"]
+if {$check_word != "0"} {
+	set found_bad $check_word
+}
+foreach badhost [string tolower $black(badhostword)] {
+if {[string match -nocase $badhost $uhost]} {
+	set found_bad $badhost
+			}
+		}
+if {$found_bad != ""} {
+	blacktools:banner:2 $nick "BADHOST:$found_bad" $chan $chan1 $host "0"
+if {[link:status $chan] == "1"} {
+	foreach c [link:chan:get $chan] {
+	blacktools:banner:2 $nick "BADHOST:$found_bad" $c $c $host "1"
+				}
+			}
+		}
+	}	
+}
+
+proc badhost:module {nick host hand chan arg} {
+	global black lastbind
+	set type 0
+	set chan1 "$chan"
+	set why [lindex [split $arg] 0]
+	set badh [join [lrange [split $arg] 1 end]]
+	set number [lindex [split $arg] 1]
+if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
+	set chan "$why"
+	set why [lindex [split $arg] 1]
+	set badh [join [lrange [split $arg] 2 end]]
+	set number [lindex [split $arg] 2]
+}
+	set return [blacktools:mychar $lastbind $hand]
+if {$return == "0"} {
+		return
+}
+	prot:module:process $nick $host $hand $chan $chan1 $why $badh $type $number "badhost"
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 69 - 0
BlackTools2.5/BlackTools/Protections/BT.badident.tcl

@@ -0,0 +1,69 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+##########################   BADIDENT TCL   #############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc badident:protect:join {nick host hand chan} {
+global black botnick
+	set found_ident ""
+if {![validchan $chan]} { return }
+if {[setting:get $chan badident]} {
+	set chan1 $chan
+if {[matchattr $hand $black(exceptflags) $chan]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+	set ident "[string map {"~" ""} [string tolower [lindex [split $host "@"] 0]]]"
+	set check_word [check:file:word $chan $ident "BADIDENT"]
+if {$check_word != "0"} {
+	set found_ident $check_word
+}
+foreach bit $black(badidentwords) {
+if {[string match -nocase $bit $ident]} {		
+	set found_ident $bit
+			}
+		}
+if {$found_ident != ""} {
+	blacktools:banner:2 $nick "BADIDENT:$found_ident" $chan $chan1 $host "0"
+if {[link:status $chan] == "1"} {
+	foreach c [link:chan:get $chan] {
+	blacktools:banner:2 $nick "BADIDENT:$found_ident" $c $c $host "1"
+				}
+			}	
+		}
+	}
+}
+
+proc badident:module {nick host hand chan arg} {
+	global black lastbind
+	set type 0
+	set chan1 "$chan"
+	set why [lindex [split $arg] 0]
+	set badi [join [lrange [split $arg] 1 end]]
+	set number [lindex [split $arg] 1]
+if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
+	set chan "$why"
+	set why [lindex [split $arg] 1]
+	set badi [join [lrange [split $arg] 2 end]]
+	set number [lindex [split $arg] 2]
+}
+	set return [blacktools:mychar $lastbind $hand]
+if {$return == "0"} {
+		return
+}
+	prot:module:process $nick $host $hand $chan $chan1 $why $badi $type $number "badident"
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 102 - 0
BlackTools2.5/BlackTools/Protections/BT.badnick.tcl

@@ -0,0 +1,102 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+###########################   BADNICK TCL   #############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc badnick:protect:join {nick host hand chan} {
+global black botnick
+	set handle [nick2hand $nick]
+	set found_nick ""
+if {![validchan $chan]} { return }
+	set chan1 $chan
+if {[setting:get $chan badnick]} {
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+	set check_word [check:file:word $chan $nick "BADNICK"]
+if {$check_word != "0"} {
+	set found_nick $check_word
+}
+foreach badnick [string tolower $black(badnickwords)] {
+if {[string match -nocase $badnick $nick]} {
+	set found_nick $badnick
+			}
+		}
+if {$found_nick != ""} {
+	blacktools:banner:2 $nick "BADNICK:$found_nick" $chan $chan1 $host "0"
+if {[link:status $chan] == "1"} {
+	foreach c [link:chan:get $chan] {
+	blacktools:banner:2 $nick "BADNICK:$found_nick" $c $c $host "1"
+				}
+			}			
+		}
+	}
+}
+
+proc badnick:protect:change {nick host hand chan newnick} {
+global black botnick
+	set handle [nick2hand $nick]
+	set found_nick ""
+if {![validchan $chan]} { return }
+if {[setting:get $chan badnick]} {
+	set chan1 $chan
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+	set check_word [check:file:word $chan $newnick "BADNICK"]
+if {$check_word != "0"} {
+	set found_nick $check_word
+}
+foreach badnick [string tolower $black(badnickwords)] {
+if {[string match $badnick [string tolower $newnick]]} {
+	set found_nick $badnick
+			}
+		}
+if {$found_nick != ""} {
+	blacktools:banner:2 $newnick "BADNICK:$found_nick" $chan $chan1 $host "0"
+if {[link:status $chan] == "1"} {
+	foreach c [link:chan:get $chan] {
+	blacktools:banner:2 $nick "BADNICK:$found_nick" $c $c $host "1"
+				}
+			}		
+		}
+	}
+}
+
+
+proc badnick:module {nick host hand chan arg} {
+	global black lastbind
+	set type 0
+	set chan1 "$chan"
+	set why [lindex [split $arg] 0]
+	set badn [join [lrange [split $arg] 1 end]]
+	set number [lindex [split $arg] 1]
+if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
+	set chan "$why"
+	set why [lindex [split $arg] 1]
+	set badn [join [lrange [split $arg] 2 end]]
+	set number [lindex [split $arg] 2]
+}
+	set return [blacktools:mychar $lastbind $hand]
+if {$return == "0"} {
+		return
+}
+	prot:module:process $nick $host $hand $chan $chan1 $why $badn $type $number "badnick"
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 83 - 0
BlackTools2.5/BlackTools/Protections/BT.badrealname.tcl

@@ -0,0 +1,83 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+#########################   BADREALNAME TCL   ###########################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc badrealname:protect:join {nick host hand chan} {
+global botnick black
+	set ::cchan $chan
+	set ::nnick $nick
+	set ::hhost $host
+	set handle [nick2hand $nick]
+if {[setting:get $chan badrealname]} {
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+if {[onchan $nick $chan]} {
+	putquick "WHOIS $nick"
+	bind RAW - 311 badrealname:protect
+		}
+	}
+}
+
+proc badrealname:protect { from keyword arguments } {
+global botnick black
+	set chan $::cchan
+	set nick $::nnick	
+	set host $::hhost
+	set chan1 $chan
+	set found_realname ""
+	set fullname [string range [join [lrange $arguments 5 end]] 1 end]
+	set check_word [check:file:word $chan $fullname "badrealname"]
+if {$check_word != "0"} {
+	set found_realname $check_word
+}
+  foreach realname $black(badfwords) {
+if {[string match -nocase $realname $fullname]} {
+	set found_realname $realname
+	}
+}
+if {$found_realname != ""} {
+	blacktools:banner:2 $nick "badrealname:$found_realname" $chan $chan1 $host "0"
+if {[link:status $chan] == "1"} {
+	foreach c [link:chan:get $chan] {
+	blacktools:banner:2 $nick "badrealname:$found_realname" $c $c $host "1"
+		}
+	}	
+}
+	unbind RAW - 311 badrealname:protect
+}
+
+proc badrealname:module {nick host hand chan arg} {
+	global black lastbind
+	set type 0
+	set chan1 "$chan"
+	set why [lindex [split $arg] 0]
+	set badf [join [lrange [split $arg] 1 end]]
+	set number [lindex [split $arg] 1]
+if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
+	set chan "$why"
+	set why [lindex [split $arg] 1]
+	set badf [join [lrange [split $arg] 2 end]]
+	set number [lindex [split $arg] 2]
+}
+	set return [blacktools:mychar $lastbind $hand]
+if {$return == "0"} {
+		return
+}
+	prot:module:process $nick $host $hand $chan $chan1 $why $badf $type $number "badrealname"
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 70 - 0
BlackTools2.5/BlackTools/Protections/BT.inviteban.tcl

@@ -0,0 +1,70 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+##########################   INVITEBAN TCL   ############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc inviteban:protect {from type arg} {
+	global black
+	set invitechan [lindex [split $arg] 1]
+	set ::invitechan $invitechan
+if {[string match -nocase "*!*" $from]} {
+	set split_from [split $from "!"]
+	set from_nick [lindex [split $split_from] 0]
+	putserv "USERHOST :$from_nick"
+	bind RAW - 302 inviteban:gethost
+	return
+}
+	putserv "USERHOST :$from"
+	bind RAW - 302 inviteban:gethost
+}
+
+proc inviteban:gethost {from keyword arguments} {
+	global black
+	set invitechan $::invitechan
+	set hostname [lindex [split $arguments] 1]
+if {[regexp {\+} $hostname]} {
+	set split_host [split $hostname "+"]
+} else {
+	set split_host [split $hostname "-"]
+}
+	set mask [lindex $split_host 1]
+	set getnick [string map {
+			"=" ""
+			":" ""
+			} [lindex $split_host 0]]
+if {$getnick != ""} {
+	set mask "$getnick!$mask"
+foreach chan [channels] {
+	set bl_protect [blacktools:protect $getnick $chan]
+if {$bl_protect == "1"} { continue }
+if {[matchattr [nick2hand $getnick] $black(exceptflags) $chan]} {
+	continue
+}
+	set chan1 $chan
+if {[setting:get $chan inviteban]} {
+	blacktools:banner:2 $getnick "INVITEBAN:[encoding convertto utf-8 $invitechan]" $chan $chan1 $mask "0"
+if {[link:status $chan] == "1"} {
+	foreach c [link:chan:get $chan] {
+	blacktools:banner:2 $getnick "INVITEBAN:[encoding convertto utf-8 $invitechan]" $c $c $mask "1"
+					}
+				}		
+			}
+		}
+	}
+	check:if:bind "inviteban:gethost" "302"
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################

+ 63 - 0
BlackTools2.5/BlackTools/Protections/BT.nickflood.tcl

@@ -0,0 +1,63 @@
+#########################################################################
+##          BlackTools - The Ultimate Channel Control Script           ##
+##                    One TCL. One smart Eggdrop                       ##
+#########################################################################
+##########################   NICKFLOOD TCL   ############################
+#########################################################################
+##						                       ##
+##     BlackTools  : http://blacktools.tclscripts.net	               ##
+##     Bugs report : http://www.tclscripts.net/	                       ##
+##     Online Help : irc://irc.undernet.org/tcl-help 	               ##
+##                   #TCL-HELP / UnderNet                              ##
+##                   You can ask in english or romanian                ##
+##					                               ##
+#########################################################################
+
+proc nickflood:protect {nick host hand chan arg} {
+global black
+if {![validchan $chan]} { return }
+if {[setting:get $chan nickflood]} {
+	set handle [nick2hand $nick]
+if {![botisop $chan] && ![setting:get $chan xonly]} { return }
+if {[matchattr $handle $black(exceptflags) $chan]} { return }
+if {[isbotnick $nick]} { return  }
+	set bl_protect [blacktools:protect $nick $chan]
+if {$bl_protect == "1"} { return }
+	set getset [setting:get $chan nickflood-repeat]
+if {$getset == ""} { set getset "$black(nickfloodrepeats)" }
+	set number [scan $getset %\[^:\]]
+	set time [scan $getset %*\[^:\]:%s]
+if {![info exists black(nick:$host:$chan:flood)]} { 
+	set black(nick:$host:$chan:flood) 0 
+}
+foreach tmr [utimers] {
+if {[string match "*nickflood:unset $host $chan*" [join [lindex $tmr 1]]]} {
+	killutimer [lindex $tmr 2]
+	}
+}
+	incr black(nick:$host:$chan:flood)
+	utimer $time [list nickflood:unset $host $chan]
+if {$black(nick:$host:$chan:flood) >= $number} {
+	blacktools:banner:1 $nick "NICKFLOOD:$arg" $chan $host [get:banmethod "nickflood" $chan] [link:chan:get $chan]
+	nickflood:unset $host $chan
+		}
+	}
+}
+
+
+proc nickflood:unset {host chan} {
+	global black
+foreach tmr [utimers] {
+if {[string match "*nickflood:unset $host $chan*" [join [lindex $tmr 1]]]} {
+	killutimer [lindex $tmr 2]
+	}
+}
+if {[info exists black(nick:$host:$chan:flood)]} { 
+	unset black(nick:$host:$chan:flood)
+	}
+}
+
+##############
+#########################################################################
+##   END                                                               ##
+#########################################################################