It should give you an error (and kick NO users) - apply proper indentation and you'll see where your error is (the foreach)flexboy wrote:Can some one help me with this it only kicks one user...
Code: Select all
setudef flag enforcebans
set enforce(max) 8;
set enforce(reasons) [list \
"Some kick message" \
"Another one!" \
"And yet another one!" \
]
bind mode - "* +b" enforceban
proc enforceban {nick uhost hand chan mc ban} {
global enforce
if {[channel get $channel enforcebans] && [botisop $chan]} {
set banmask [string map {"\\" "\\\\" "\[" "\\["} $ban]
set reason [lindex $enforce(reasons) [rand [llength $enforce(reasons)]]]
set list [list]
foreach user [chanlist $chan] {
if {[isbotnick $user] || [matchattr [nick2hand $user] f|f $chan]} {
continue
} elseif {[string match -nocase $banmask $user![getchanhost $user $chan]]} {
lappend list $user
}
}
if {[llength $list] > $enforce(max)} {
putserv "MODE $chan -ob $nick $ban"
} else {
foreach user $list {
putserv "KICK $chan $user :$reason"
}
}
}
} "putkick" and the conf variable "kick-method" exists for a reason - so you don't need to care about that in your scriptsmetroid wrote:not alot of IRCd's actually support kicking 3 people at the same time (I think)