All pastes #447588 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-19 04:49 UTC
rendered paste body
kb {
  if (!$1) { echo 4 -a KB Usage: /kb [Time] [Chan] NICK [Reason] | halt }
  elseif ($left($1,1) == $chr(35)) { var %chans = $1 | tokenize 32 $2- }
  elseif ($left($2,1) == $chr(35)) { var %chans = $2 | tokenize 32 $1 $3- }
  elseif ($left($3,1) == $chr(35)) { var %chans $3 | tokenize 32 $1-2 $4- }
  else var %chans = $chan
  var %time = $calc($replace($1,s,*1+,m,*60+,h,*3600+,d,*86400+,w,*604800+)), %banmask = $iif($network == swiftirc,3,2), %x 1
  if (%time) tokenize 32 $2-
  while (%x <= $numtok(%chans,44)) {
    var -s %chan = $gettok(%chans,%x,44)
    if (($me isop %chan) || ($me ishop %chan)) && ($1 ison %chan) {
      if ($1 isop %chan) || ($1 ishop %chan) mode %chan -oh $1 $1
      ban -k $+ $iif(%time,u $+ %time) %chan $1 %banmask $iif($2,$2-,No reason given) $iif(%time,- banned for $duration(%time)) 
    }   
    inc %x
  }
}