This is bad nickname kicker working fine ... but when flooder join with ban nick bot make ban one by one .. it's possible to make bot ban max in the raw ... ..
# advanced badnick script v. 0.1 by SpiKe^^ #
# list of badnicks #
set bnik(nicks) "sumbadword notherbadword"
# list badnick channel(s) or "*" for all channels #
set bnik(chans) "#sumChannel #notherChan"
# max number of bans to stack in one mode command (1 or more) #
set bnik(maxban) 6
# set seconds to wait before removing bans or 0 to not remove #
set bnik(btime) 30
# max number of kicks to stack in one kick command (1 or more) #
set bnik(maxkick) 3
# set the kick-ban reason #
set bnik(reasn) "\00304Bad Nick \00314Type: \002/nick New-Nick\002\00304 & rejoin the channel."
# set exempt userfile flags or "" for none #
set bnik(xflag) "bmno|o"
# exempt all users with +o in the channel ?? #
# ! this will add a brief delay (2 second minimum) ! #
# 0 = disabled: don't exempt users with +o #
# 1 = exempt all users with +o #
# 2 = also exempt users with +v #
set bnik(xops) 2
# set seconds to wait before checking the channel for +o or +v #
set bnik(otime) 2 ;# (0 = no delay) OR 2+ secs #
# set seconds to wait to gather a queue (1 or more) #
set bnik(qtime) 2
#### !End of Settings! !End of Settings! !End of Settings! ####
set bnik(nicks) [split [string tolower $bnik(nicks)]]
set bnik(chans) [split [string tolower $bnik(chans)]]
if {$bnik(xops)!=1 && $bnik(xops)!=2} { set bnik(xops) 0 }
bind join - * join:badnick
proc join:badnick {nk uh hn ch} { global bnik bnop
if {[isbotnick $nk]} { return }
set ch [string tolower $ch]
if {[lsearch -exact $bnik(chans) $ch] == -1 && $bnik(chans)!="*"} { return }
if {$bnik(xflag)!="" && [matchattr $hn $bnik(xflag) $ch]} { return }
foreach badnk $bnik(nicks) {
if {[string match -nocase *$badnk* $nk]} { set isbad $badnk ; break }
}
if {![info exists isbad]} { return }
set tid $ch,[unixtime]
lappend bnop($tid) [string tolower $nk!$uh!$isbad]
if {$bnik(otime)==0} { check:badnick $tid
} elseif {[llength $bnop($tid)]==1} {
utimer $bnik(otime) [list check:badnick $tid]
}
return
}
proc check:badnick {tid} { global bnik bnop bnqu
lassign [split $tid ","] ch ut
if {![info exists bnop($tid)]} { return }
foreach nkuh $bnop($tid) { lassign [split $nkuh "!"] nk uh isbad
if {$bnik(xops)>0 && [isop $nk $ch]} { continue }
if {$bnik(xops)>1 && [isvoice $nk $ch]} { continue }
if {![info exists bnqu($ch)]} {
utimer $bnik(qtime) [list queue:badnick $ch]
}
lappend bnqu($ch) $nkuh
}
unset bnop($tid)
}
proc queue:badnick {ch} { global bnik bnqu
if {![info exists bnqu($ch)]} { return }
if {![botisop $ch]} { unset bnqu($ch) ; return }
set banList "" ; set nickList ""
foreach nkuh $bnqu($ch) { lassign [split $nkuh "!"] nk uh isbad
if {![onchan $nk $ch]} { continue }
set bmask "*$isbad*!*@*"
if {[lsearch $banList $bmask] == -1} { lappend banList $bmask }
if {[lsearch $nickList $nk] == -1} { lappend nickList $nk }
}
unset bnqu($ch)
set len [llength $banList] ; set max $bnik(maxban)
while {$len > 0} {
if {$len > $max} {
set mode [string repeat "b" $max]
set masks [join [lrange $banList 0 [expr {$max - 1}]]]
set banList [lrange $banList $max end]
incr len -$max
} else {
set mode [string repeat "b" $len]
set masks [join $banList]
set len 0
}
putquick "MODE $ch +$mode $masks"
if {$bnik(btime) > 0} {
utimer $bnik(btime) [list putquick "MODE $ch -$mode $masks"]
}
}
set len [llength $nickList] ; set max $bnik(maxkick)
while {$len > 0} {
if {$len > $max} {
set nicks [join [lrange $nickList 0 [expr {$max - 1}]] ,]
set nickList [lrange $nickList $max end]
incr len -$max
} else {
set nicks [join $nickList]
set len 0
}
putquick "KICK $ch $nicks :$bnik(reasn)"
}
}
hi SpiKe^^
interesting its writing but it would be good to also have an example warning set that warns 3 times and of bankick and that also recognizes the variant of nickname changes is to say that when the offender changes the nickname he still recognizes it and applies the warning set..
example; description; that the bot warns 2 times and the third one that ban kick /// if the set is 0 then it is direct ban when entering the channel set warnings 3
it would be great if your writing has that already mentioned
set of warnings and nickname acknowledgments when you have changed to another nickname;
* symors (~Apna@181.115.129.223) has joined #beni2
* symors is now known as horny
eggdrop in channel; horny, change your nick please, 1 warning
eggdrop in channel; horny, if you don't change your nickname you will be ejected last warning.
in channel; * horny was kicked by eggdrop (sorry on this channel badnicks are not allowed) or -----
* horny (~Apna@181.115.129.223) has joined #beni2
eggdrop in channel; horny, change your nick please, 1 warning
eggdrop in channel; horny, if you don't change your nickname you will be ejected last warning.
in channel; * horny was kicked by eggdrop (sorry on this channel badnicks are not allowed)