All pastes #828515 Raw Edit

Someone

public text v1 · immutable
#828515 ·published 2007-12-22 15:15 UTC
rendered paste body
################################################################
#/Except <User> - This adds a user to the "except" list.       #
#/Except -r <User> - This delete a user from the "except" list.# 
################################################################



Alias IdleChan return #IRChat 
Alias ServiceBot return ServiceBot 
ON *:START:{ 
  if (!%Excepts) { 
    set %Excepts Users: :END 
  } 
} 
ON *:LOAD:{ 
  if (!%Excepts) { 
    set %Excepts Users: :END 
  } 
} 
ON *:CONNECT:{ 
  if (* $me * iswm %Excepts) { 
    set %Excepts $replace($remove(%Excepts,:END) $me :END,$str($chr(32),2),$chr(32)) 
  } 
} 
ON *:BAN:$($IdleChan):{ 
  if ($nick != ChanServ && $nick != $ServiceBot && * $nick * !iswm %Excepts) { 
    mode $chan +b-baohv $wildsite $banmask $str($nick $chr(32),4) 
    ban -u60 $chan $nick 2 
  } 
} 
On *:RAWMODE:$($IdleChan):{ 
  if (* $nick * !iswm %Excepts) { 
    if (*e*,*,*,* iswmcs $chanmodes) { 
      var %a = 1, %b, %c = 2 
      while ($mid($1,%a,1)) { 
        if ($v1 isin +-) %b = $v1 
        if ($v1 === e) { 
          if (%b == +) { 
            mode $chan -e $($+($,%a),2) 
          } 
          else { 
            mode $chan +e $($+($,%a),2) 
          } 
        } 
        if ($regex($nickmode $chanmodes,/(?:^|,)(?=.* $v1 )/gx) %b isin 3 +1 %b 2 %b) inc %c 
        inc %a 
      } 
    } 
    if (*I*,*,*,* iswmcs $chanmodes) { 
      var %a = 1, %b, %c = 2 
      while ($mid($1,%a,1)) { 
        if ($v1 isin +-) %b = $v1 
        if ($v1 === I) { 
          if (%b == +) { 
            mode $chan -I $($+($,%a),2) 
          } 
          else { 
            mode $chan +I $($+($,%a),2) 
          } 
        } 
        if ($regex($nickmode $chanmodes,/(?:^|,)(?=.* $v1 )/gx) %b isin 3 +1 %b 2 %b) inc %c 
        inc %a 
      } 
    } 
  } 
} 
Alias Except { 
  if ($1 == -r) { 
    if (!$2) { 
      echo -at [error] No user given 
    } 
    else { 
      if (* $2 * !iswm %Excepts) { 
        echo -at [error] Can't delete $+($chr(2),$2,$chr(2)) from except list. User not there 
      } 
      else { 
        set %Excepts $replace($remove(%Excepts,$2),$str($chr(32),2),$chr(32)) 
        echo -at Deleted $+($chr(2),$2,$chr(2)) from except list 
      } 
    } 
  } 
  elseif (!$1) { 
    echo -at [error] No user given 
  } 
  else { 
    if (* $1 * iswm %Excepts) { 
      echo -at [error] Can't add $+($chr(2),$1,$chr(2)) to except list. User allready there 
    } 
    else { 
      set %Excepts $replace($remove(%Excepts,:END) $1 :END,$str($chr(32),2),$chr(32)) 
      echo -at Added $+($chr(2),$1,$chr(2)) to except list 
    } 
  } 
}