# Set the next line as the kick msg you want to say
set clone_msg "Clones"
# Set the next line as the number of clones to scan for
set clone_max 3
# Set the next line as the channels you want to run in
set clone_chans "#MyChan"
proc join_clone {nick uhost hand chan} {
global clone_msg clone_max clone_chans botnick
if {(([lsearch -exact [string tolower $clone_chans] [string tolower $chan]] != -1) || ($clone_chans == "*")) && (![matchattr $hand m|m $chan]) && (![matchattr $hand b]) && ($nick != $botnick)} {
set host [lindex [split $uhost @] 1]
set count 0
foreach i [chanlist $chan] {
if {[lindex [split [getchanhost $i $chan] @] 1] == $host} { incr count }
}
if {$count >= $clone_max} {
newchanban $chan [maskhost [getchanhost $nick $chan]] $botnick $clone_msg 10min
putserv "KICK $chan $nick :$clone_msg"
}
}
}
bind join - * join_clone
putlog "=====>> Clone Protection Loaded"
The problem is that it puts the ban in the bot's internal banlist instead of a channel ban. Now, have in mind that i dont know tcl scripting, but, my first guess, would be to replace this line:
#Set the next line as the kick msg you want to say
set clone_msg "Clones"
#Set the next line as the number of clones to scan for
set clone_max 3
#Set the next line as the channels you want to run in
set clone_chans "#MyChan"
proc join_clone {nick uhost hand chan} {
global clone_msg clone_max clone_chans botnick
if {([lsearch -exact [string tolower $clone_chans] [string tolower $chan]] != -1) || ($clone_chans == "*") && ![matchattr $hand m|m $chan] && ![matchattr $hand b] && ![isbotnick $nick] && [botisop $chan]} {
set host [lindex [split $uhost @] 1]; set count 0
foreach i [chanlist $chan] {
if {[string equal -nocase $host [lindex [split [getchanhost $i $chan] @] 1]]} {
incr count
}
}
if {$count >= $clone_max} {
putquick "MODE $chan +b *!*@$host" -next
foreach clone [chanlist $chan] {
if {[string equal -nocase $host [lindex [split [getchanhost $i $chan] @] 1]]} {
putquick "KICK $chan $clone :$clone_msg" -next
}
}
}
}
}
Although we can run only 1 loop, remove the second one, in the first one lappend nicks to a list, if not greater unset list, if greater go ahead and kick everyone in the list no need to scan the chanlist again for users matching the mask.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
#Set the next line as the kick msg you want to say
set clone_msg "Clones"
#Set the next line as the number of clones to scan for
set clone_max 3
#Set the next line as the channels you want to run in
set clone_chans "#MyChan"
proc join_clone {nick uhost hand chan} {
global clone_msg clone_max clone_chans botnick
if {([lsearch -exact [string tolower $clone_chans] [string tolower $chan]] != -1) || ($clone_chans == "*") && ![matchattr $hand m|m $chan] && ![matchattr $hand b] && ![isbotnick $nick] && [botisop $chan]} {
set host [lindex [split $uhost @] 1]; set count 0
foreach i [chanlist $chan] {
if {[string equal -nocase $host [lindex [split [getchanhost $i $chan] @] 1]]} {
incr count
}
}
if {$count >= $clone_max} {
putquick "MODE $chan +b *!*@[lindex [split $uhost @] 1]" -next
foreach clone [chanlist $chan] {
if {[string equal -nocase [lindex [split $uhost @] 1] [lindex [split [getchanhost $i $chan] @] 1]]} {
putquick "KICK $chan $clone :$clone_msg" -next
}
}
}
}
}
putlog "=====>> Clone Protection Loaded"
# Set the next line as the kick msg you want to say
set clone_msg "Clones"
# Set the next line as the number of clones to scan for
set clone_max 3
# Set the next line as the channels you want to run in
set clone_chans "#MyChan"
proc join_clone {nick uhost hand chan} {
global clone_msg clone_max clone_chans botnick
if {(([lsearch -exact [string tolower $clone_chans] [string tolower $chan]] != -1) || ($clone_chans == "*")) && (![matchattr $hand m|m $chan]) && (![matchattr $hand b]) && ($nick != $botnick)} {
set host [lindex [split $uhost @] 1]
set count 0
foreach i [chanlist $chan] {
if {[string equal -nocase [lindex [split [getchanhost $i $chan] @] 1] $host]} {
incr count
lappend cnicks "$i"
}
}
if {$count >= $clone_max} {
putquick "MODE $chan +b *!*@$host"
foreach cnick $cnicks {
putquick "KICK $chan $cnick :$clone_msg"
}
}
}
}
bind join - * join_clone
This should do the job, but if the bot is a clone then it'll kick itself too