Lego, instead of adding and deleting bans with the type 2 address, why not make a variable for $address($2,2) so you don't have to enter the exact address but the nickname to add and delete? Your script can be consolidated as such:
on @*:join:#:{
if $readini(bans.ini,#,$wildsite) {
ban -k # $nick 2 banned.
}
}
on @$*:text:/^\$(add|del)?(bans?)|(kb)\b/iS:#:{
if !%p {
inc -u4 %p
if $nick isop # {
var %type2 $address($2,2)
if $regml(1) = add {
writeini bans.ini # %type2 %type2
notice $nick $regml Is banned from # $+ .
mode # +b %type2
}
elseif $regml(1) = del {
remini bans.ini # %type2
notice $nick $2 Is unbanned from # $+ .
mode # -b %type2
}
elseif $regml(1) = bans {
notice $nick $+ # Bans.
var %c 0, %t $ini(bans.ini,#,0)
while (%c < %t) {
inc %c
notice $nick $readini(bans.ini,#,$ini(bans.ini,#,%c))
}
notice $nick $+ %c bans found.
}
else {
writeini bans.ini # %type2 %type2
ban -k # $2 2 kickbanned by $nick
}
}
else {
notice $nick You lack access to # $+ .
}
}
}
:)