All pastes #633989 Raw Edit

Unnamed

public text v1 · immutable
#633989 ·published 2007-07-26 02:27 UTC
rendered paste body
on *:JOIN:#:.timer 1 1 bc $nick $chan 

alias -l bc { 
  if ($read(Blacklist.txt,w,$1)) || ($read(Blacklist.txt,w,$address($1,2))) { 
    var %rd = $readn 
    if (($me !isop $2) && ($me !ishop $2)) || (*Q* iswmcs $chan($2).mode) || (($me ishop $2) && ($1 isop $2)) echo -st  Blacklist match! Channel: $2 Nick: $1 Address: $Address($1,2) Match: $iif($chr(64) isin $ifmatch,Address,Nick) Reason: $iif($read(BlackListReason.txt,%rd) == Null,Unspecified,$read(BlackListReason.txt,%rd)) but you cannot ban them. 
    else { 
      echo -st  Blacklist match! Channel: $2 Nick: $1 Address: $Address($1,2) Match: $iif($chr(64) isin $ifmatch,Address,Nick) Reason: $iif($read(BlackListReason.txt,%rd) == Null,Unspecified,$read(BlackListReason.txt,%rd)) and but you owned them
      ban -ku1800 $2 $1 2 [Blacklisted] Reason: $iif($read(BlackListReason.txt,%rd) == Null,Unspecified,$read(BlackListReason.txt,%rd)) $kickc 
    } 
  } 
} 
alias bl { 
  if ($2) { 
    write BlackList.txt $iif($1 ison $active,$address($1,2),$1) 
    write BlackListReason.txt $2- 
    echo -ta [Blacklist] Successfully written $1 to blacklist. Reason: $2- 
    if ($1 ison $active) { 
      if (($me !isop $active) && ($me !ishop $active)) || (*Q* iswmcs $chan($active).mode) || (($me ishop $chan(%x)) && ($nick($chan(%x),%y) isop $chan(%x))) echo -st I cannot kick $1 from $active $+ ! 
      else ban -ku1800 $active $1 2 [Blacklisted] Reason: $iif($2,$2-,Unspecified) $kickc 
    } 
  } 
  else { 
    write BlackList.txt $iif($1 ison $active,$address($1,2),$1) 
    write BlackListReason.txt Null 
    echo -ta [Blacklist] Successfully written $1 to blacklist. No reason specified. 
    if ($1 ison $active) { 
      if (($me !isop $active) && ($me !ishop $active)) || (*Q* iswmcs $chan($active).mode) || (($me ishop $chan(%x)) && ($nick($chan(%x),%y) isop $chan(%x))) echo -st I cannot kick $1 from $active $+ ! 
      else ban -ku1800 $active $1 2 [Blacklisted] Reason: $iif($2,$2-,Unspecified) $kickc 
    } 
  } 
} 
alias bldel { 
  if (!$1) { echo -ta [Blacklist] Error: Invalid syntax. Use: /bldel <Address/Nick>. | halt } 
  if ($read(Blacklist.txt,w,$address($1,2))) || ($read(Blacklist.txt,w,$1)) || ($read(Blacklist.txt,w,$($+(%Address.,$1),2))) { 
    echo -ta [Blacklist] $1 was found on the blacklist on line $readn $+ . Match: $read(BlackList.txt,$readn) $+ . 
    echo -ta [Blacklist] Blacklist reason: $iif($read(BlackListReason.txt,$readn) == Null,Unspecified,$read(BlackListReason.txt,$readn)) 
    echo -ta [Blacklist] To delete: /yes. To stop: /no. 
    set %B $readn 
  } 
  else echo -ta [Blacklist] Sorry: $1 was not found on the blacklist. 
} 
alias yes { 
  if (%B) { 
    set -u600 %r $read(BlackList.txt,%B) 
    set -u600 %rr $read(BlackListReason.txt,%B) 
    echo -ta [Blacklist] Deleting: $read(BlackList.txt,%B) With reason: $iif($read(BlackListReason.txt,%B) == Null,Unspecified,$read(BlackListReason.txt,%B)) from the blacklist. 
    write -dl [ $+ [ %B ] ] BlackList.txt 
    write -dl [ $+ [ %B ] ] BlackListReason.txt 
    unset %B 
    GlobalUnban $iif($chr(64) !isin $read(BlackList.txt,%B),$address($v2,2),$v2) 
  } 
  else echo -ta [Blacklist] Error: No blacklist set to delete. Try /bldel <Address/Nick>. 
} 
alias no { 
  if (%B) { 
    echo -ta [Blacklist] Cancelled: $read(BlackList.txt,%B) Will not be deleted from the blacklist. 
    unset %B 
  } 
  else echo -ta [Blacklist] Error: No blacklist set to delete. Try /bldel <Address/Nick>. 
} 
alias rebl { 
  if (%r) { 
    write BlackList.txt %r 
    write BlackListReason.txt %rr 
    echo -ta [Blacklist] Successfully re-written %rbl to blacklist. Reason: $iif(%rblr == Null,Unspecified,%rblr) $+ . 
    unset %r %rr 
  } 
  else echo -ta [Blacklist] Error: No user was recently un-blacklisted. 
} 
alias bllist { 
  if ($lines(BlackList.txt) >= 30) $iif($?!="30+ Blacklists found. Continue? $crlf $+ Doing so will echo $lines(BlackList.txt) lines into $active $+ .",,halt) 
  echo -ta [Blacklist] Blacklisted user list $+([,,$lines(BlackList.txt),/,$lines(BlackListReason.txt),]:) (Latest first) 
  if ($lines(BlackList.txt) == 0) echo -ta [Blacklist] None. 
  else { 
    var %la = $lines(BlackList.txt) 
    var %lc = $lines(BlackList.txt) 
    while (%lc >= 1) { 
      echo -ta $+([,$calc((%la - %lc) + 1),]) User: $read(BlackList.txt,%lc) Reason: $iif($read(BlackListReason.txt,%lc) == Null,Unspecified,$read(BlackListReason.txt,%lc)) 
      dec %lc 
    } 
  } 
} 
alias BlCheck { 
  var %x = 1, %z = 0, %w = 0 
  while (%x <= $chan(0)) { 
    var %y = 1 
    while (%y <= $nick($chan(%x),0)) { 
      if ($read(Blacklist.txt,w,$nick($chan(%x),%y))) || ($read(Blacklist.txt,w,$address($nick($chan(%x),%y),2))) { 
        var %q = $readn 
        inc %z 
        echo -s /!\ Blacklist match: Channel: $chan(%x) Nick: $nick($chan(%x),%y) Match: $ifmatch 
        if ($me !isop $chan(%x)) && ($me !ishop $chan(%x)) || (*Q* iswmcs $chan($chan(%x)).mode) || (($me ishop $chan(%x)) && ($nick($chan(%x),%y) isop $chan(%x))) echo -s I cannot kick $nick($chan(%x),%y) from $chan(%x) $+ ! 
        else ban -ku300 $chan(%x) $nick($chan(%x),%y) 2 [Blacklisted] Reason: $iif($read(BlackListReason.txt,%q) == Null,Unspecified,$read(BlackListReason.txt,%q)) $kickc 
      } 
      inc %w 
      inc %y 
    } 
    inc %x 
  } 
  echo -s Finished checking %w users on $chan(0) $+ $iif($chan(0) == 1,channel,channels) $+ , blacklists found: %z 
} 
alias GlobalUnban { 
  if (!$1) halt 
  var %x = 1, %z = 0 
  while (%x <= $chan(0)) { 
    if ($me isop $chan(%x)) || ($me ishop $chan(%x)) mode $chan(%x) -b $1 
    inc %x 
  }