Jethro commented on a Page, Ban script  -  Jan 27, 2011

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 # $+ . 
    }
  }
}
berend  -  Jan 10, 2020

:)

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.