Kod: Kodu kopyalamak için üzerine çift tıklayın!
bind pub -|- .b pub:ban
proc pub:ban {nick host hand chan text} {
set chan [string tolower $chan]
if {$chan == "#mainchan" || $chan == "#staffchannel" } {
if {![onchan $nick #help]} { return }
set users [list]
set umasks [list]
set text [string trim $text]
if { $text eq "" } { set text $nick }
set text [split $text]
set last_el [lindex $text end]
## determine if last element is a number. If it is, use it as ban time in minutes. If it is not, then default bant time is 5 minutes.
if {[string is digit $last_el]} {
set text [lrange $text 0 end-1]
set ban_time $last_el
} else {
set ban_time 5
}
foreach user $text {
if {![onchan $user #mainchan]} {
putserv "NOTICE $nick $user is not on channel #mainchan"
} elseif {[isop $user #mainchan]} {
putserv "notice $nick :$user is op on #mainchan "
} else {
if {[onchan $user #staffchannel]} {
putserv "NOTICE $nick $user is on channel #staffchannel dont ban him/her"
}
if {[set chost [getchanhost $user #mainchannel]] ne ""} {
switch -glob -- $chost {
{*.irccloud.com} - {*.mibbit.com} - {*.kiwiirc.com} - {*.5A29D2BF.IP} {
set mask2x *![lindex [split $chost @] 0]@*
}
{default} {
set mask2x [maskhost "$user!$chost" 2]
}
}
lappend users $user
lappend umasks $mask2x
}
}
}
set count [llength $umasks]
stackBans3a #mainchannel [join $umasks] 12
stackvoices31x #mainchannel [join $umasks] 12
after [expr $ban_time*1000*60] [list stackBans4a #mainchannel [join $umasks] 12 ]
}
}
try this