All pastes #597929 Raw Edit

Stuff

public text v1 · immutable
#597929 ·published 2007-06-30 22:56 UTC
rendered paste body
on $*:TEXT:/^!mute( .+)?$/Si:#PCPlace:{
  if ($nick !isreg $chan) {
    if (!$3) .notice $nick $c1(Syntax:) $c2(!mute <nick> <minutes> [reason])
    elseif ($2 !ison $chan) .notice $nick $+($c1("),$2,$c1(" is not currently in) $c2($chan),$c1(.))
    elseif ($3 !isnum $+(0-,$regsubex($nick($chan,$nick).pnick,/^(.).+$/,$replace(\1,@,$str(9,50),%,10,+,5)))) .notice $nick $c1(You must specify a mute duration [must be less than) $+($c2($v2),$c2(].))
    elseif ($regsubex($nick($chan,$2).pnick,/^(.).+$/,$replace(\1,@,3,%,2,+,1)) >= $regsubex($nick($chan,$nick).pnick,/^(.).+$/,$replace(\1,@,3,%,2,+,1))) .notice $nick $c1(You cannot mute users who have equal or greater status than yourself.)
    else mute $chan $2- 
  }
}
alias mute {
  var %c = $active
  if ($1 ischan) {
    %c = $1
    tokenize 32 $2-
  }
  if ($1 !isreg %c) mode %c $+(-,$regsubex($nick(%c,$1).pnick,/^([@%+]+)(.+)$/,$+($replace(\1,@,o,%,h,+,v),$str($+($chr(32),\2),$len(\1)))))
  ban $+(-u,$calc($2 * 60)) %c $+(~q:,$address($1,2))
  .notice $2 $c1(You have been muted for) $c2($2) $c1($+(minutes,$chr(44)) because:) $c2($iif($3,$3-,No reason.))
}