All pastes #606941 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-07-07 06:55 UTC
rendered paste body
[script]
n0=;# Global Blacklist v0.01
n1=;# Commands
n2=;
n3=;# $gb [nick] (If the nick is on that channel.)
n4=;# $add gb $address([nick],2)
n5=;# $scan gb (Just incase they got past the blacklist if the bot wasn't opped.)
n6=;# $removegb $address([nick],2)
n7=;# $gblist (Shows you the blacklisted addresses.)
n8=;# $cleargb (Removes all blacklisted addresses.)
n9=
n10=
n11=;#The Code.
n12=
n13=ON *:TEXT:$($!gb*):#:{
n14=  if ($Nick isop #fusionbot) {
n15=    if ($istok(%gb, $address($2,2), 32)) { msg #FusionBot-Admins [Blacklist]: That user/host was found in the blacklist database. | halt }
n16=    set %gb $addtok(%gb, $address($2,2), 32)
n17=    var %a = $comchan($2,0) 
n18=    while (%a) {
n19=      if ($me isop $comchan($2,%a)) { 
n20=        ban -k $comchan($2,%a) $2 [Blacklisted] User/host was found in the blacklist database. 
n21=      } 
n22=      dec %a 
n23=    }
n24=  }
n25=}
n26=ON *:TEXT:$($!add gb*):#:{
n27=  if ($Nick isop #fusionbot) {
n28=    if ($istok(%gb, $3, 32)) { msg #FusionBot-Admins [Blacklist]: That user/host was found in the blacklist database. | halt }
n29=    set %gb $addtok(%gb, $3, 32)
n30=    msg #FusionBot-Admins [Blacklist]: Added  $+ $3 $+  to the blacklist database. | halt
n31=  }
n32=}
n33=ON *:TEXT:$($!scan gb):#:{
n34=  if ($Nick isop #fusionbot) {
n35=    .quote WHO $+(:,$chan)
n36=    var %i = $nick($chan,0) 
n37=    while (%i) { 
n38=      if ($istok(%gb,$address($nick($chan,%i),1),32)) { 
n39=        inc %banned
n40=        ban -k $chan $nick($chan,%i) 2 [Blacklist]: User/host was found in the blacklist database.
n41=      } 
n42=      dec %i 
n43=    }
n44=  } 
n45=}
n46=on me:*:JOIN:#:.quote WHO $+(:,$chan)
n47=on *:OP:#: { 
n48=  if ($opnick == $me) { 
n49=    var %i = $nick($chan,0) 
n50=    while (%i) { 
n51=      if ($istok(%gb,$address($nick($chan,%i),1),32)) { 
n52=        inc %banned
n53=        ban -k $chan $nick($chan,%i) 2 [Blacklist]: User/host was found in the blacklist database.
n54=      } 
n55=      dec %i 
n56=    }
n57=  } 
n58=}
n59=ON *:JOIN:#:{
n60=  if ($istok(%gb, $address($nick,2), 32)) {
n61=    ban -k $chan $nick [Blacklist]: User/host was found in the blacklist database.
n62=  } 
n63=}
n64=ON *:TEXT:$($!cleargb):#:{
n65=  if ($Nick isop #fusionbot) {
n66=    unset %gb
n67=    msg #FusionBot-Admins [Blacklist]: All blacklisted users/hosts were cleared. Blacklist database status: N/A.
n68=  }
n69=}
n70=ON *:TEXT:$($!viewgb):#:{
n71=  if ($Nick isop #fusionbot) {
n72=    if (!%gb) { msg #FusionBot-Admins [Blacklist]: (Error) No hosts/users were found in the blacklist database. Blacklist database status: N/A. | halt }
n73=    else {
n74=      msg #FusionBot-Admins [Blacklist]: Blacklisted users/hosts: %gb
n75=    }
n76=  }
n77=}
n78=ON *:TEXT:$($!removegb*):#:{
n79=  if ($Nick isop #fusionbot) {
n80=    if (!$istok(%gb, $2, 32)) { msg #FusionBot-Admins [Blacklist]: That user/host was found in the blacklist database. | halt }
n81=    else {
n82=      set %gb $remtok(%gb, $2, 32)
n83=      msg #FusionBot-Admins [Blacklist]: $2 was removed from the blacklisted hosts/users.
n84=    }
n85=  }
n86=}