ON @*:TEXT:!*bans:#: {
if ( $1 == !listbans ) {
.mode # b
var %a = 1, %b = $ibl(#,0), %c
while %a <= %b {
if ( $numtok(%c,32) < $modespl ) %c = $addtok(%c,$ibl(#,%a),32)
else {
msg $chan %c
%c = ""
}
inc %a
}
if ( %c ) msg $chan %c
}
elseif ( $1 == !removeoldbans ) {
.mode # b
var %a = 1, %b = $ibl(#,0), %c
while %a <= %b {
if ( $numtok(%c,32) < $modespl ) && ( $calc($ctime - $ibl(#,1).ctime) > 2 ) %c = $addtok(%c,$ibl(#,%a),32)
else {
mode $chan $str(-b,$modespl) %c
%c = ""
}
inc %a
}
if ( %c ) mode $chan $str(-b,$modespl) %c
}
}