ComputerTech Owner
Posts : 99 Points : 268 Reputation : 0 Join date : 2020-04-30
| Subject: BlackShadows BlackTools's Clonescanner module 21/5/2020, 23:59 | |
| Hey all so this is Blackshadows BlackTools Clonescanner module made into one single script enjoy - Code:
-
#Set max clones
set scn(maxclone) "3"
#Set the time span between channel clone scans
set scn(time) "1"
#Set here the flags to call the bind
set scn(flags) "o|o"
#Set to 1 for kickban #Set to 0 for notify
set scn(what) "0"
#If you set to scn (what) "1" set the reason for the kickban here.
set scn(reason) "This host% host% has exceeded the number of clones accepted on %chan%. For more info contact Operators."
#If you have set to scn (what) "1" set here the duration of the Ban. (minute)
set scn(btime) "30"
bind pub $scn(flags) .clonescan scanner setudef flag clonescan
if {![info exists clonescanner_running]} { timer $scn(time) clonescan:timer set clonescanner_running 1 }
proc scanner {nick host hand chan arg} { global scn array set clones [list] clonescan:act $chan $nick $hand 0 0 }
proc clonescan:timer {} { global scn set type 1 set channels "" foreach chan [channels] { if {[validchan $chan] && [channel get $chan clonescan]} { lappend channels $chan } } if {$channels != ""} { clonescan:act $channels "nick" "chan1" 1 0 } }
proc clonescan:act {channels nick hand type counter} { global scn botnick set chan [lindex $channels $counter] set cc [expr $counter + 1] set found_clones 0 set found_mask "" set theclones "" array set clones [list] if {$chan != ""} { set replace(%chan%) $chan foreach user [chanlist $chan] { set host [string tolower [lindex [split [getchanhost $user $chan] @] 1]] if {[string match "*undernet.org*" $host]} { continue } set replace(%host%) $host lappend clones($host) $user } foreach clone [array names clones] { set userlist [join $clones($clone)] if {[llength [split $userlist]] >= $scn(maxclone)} { set found_clones 1 lappend found_mask $clone lappend theclones $clones($clone) if {$type == "0"} { putserv "PRIVMSG $nick :We Found [llength [split $userlist]] clone on $chan from the host $clone. these are9: [join $clones($clone) ", "]" } } } if {$found_clones == "1"} { if {$type == "1"} { putserv " @$chan :[llength [split $theclones]] $found_mask. These are: [join $theclones " ,"]" } if {$scn(what) == "1"} { foreach m $found_mask { set mask "*!*@$m" set replace(%chan%) $chan set reason [string map [array get replace] $scn(reason)] newchanban $chan $mask $botnick $reason $scn(btime) } } } } if {([lindex $channels $cc] != "") && ($type == "1")} { utimer 5 [list clonescan:act $channels $nick $hand $type $cc] } if {($type == "0") && ($found_clones == "0")} { putserv "PRIVMSG $chan :\005\[BT\]\005 We didn't find clones on $chan." } }
| |
|