Paste: shqLhDHR1YN2
  • Author: entropy (Online)
  • Description: Deop Protection v1.2
  • Added: August 11th 2016 (9h26m31s ago)
  • Last Edited: August 11th 2016 (7h2m13s ago)
  • Expires: Never
  • Hits: 54
  • Size: 1.31KB
  • Rating: (excellent) (1 vote)
  • Language: mirc
Screenshot image:
(click to enlarge)

  1. ; Deop Protection v1.2 (for channels without services) - by entropy 2016
  2. ; Set: %protect to the nicks to protect
  3. ; Set #latenightcafe to the channel to use it on
  4.  
  5. on !@*:deop:#latenightcafe:{ 
  6.   %protect = ent samovar shame orkin tim-allen VanyelX chatchat Zmodem
  7.   if ($nick != $opnick) { 
  8.     if ($istok(%protect,$opnick,32)) { 
  9.       %nicks = %nicks $opnick
  10.       .timermode -om 1 200 pushmodex # $+(-o+,$str(o,$numtok(%nicks,32))) $nick %nicks
  11.       if ($numtok(%nicks,32) >= 3) { ban -ku60 # $nick 3 Mass Deop }
  12.       .timernicks -o 1 2 unset %nicks
  13.     }
  14.   }
  15. }
  16. alias -l pushmodex {
  17.   var %modespl = $modespl , %chan = $1 , %modes = $2 , %parms = $3- , %x = 1 , %y = $len(%modes) , %lwhich = + , %which = + , %a , %b
  18.   tokenize 44 $chanmodes
  19.   var %t1 = $1 , %t2 = $nickmode $+ $2 , %t3 = $3 , %t4 = $4
  20.  
  21.   tokenize 32 %parms
  22.   while (%x <= %y) {
  23.     var %t = $mid(%modes,%x,1)
  24.     if (%t isin +-) { var %lwhich = %which , %which = %t }
  25.     else {
  26.       if (%t isincs $gettok(%t1 %t2 %t3, 1- $pos(.-+, %which),32)) {
  27.         var %b = %b $1
  28.         tokenize 32 $2-
  29.       }
  30.       var %a = $+(%a,$iif(!%a || %lwhich != %which,%which),%t) , %lwhich = %which
  31.       if ($len($remove(%a,+,-)) = %modespl) {
  32.         mode %chan %a %b
  33.         var %a = "" , %b = ""
  34.       }
  35.     }
  36.     inc %x
  37.   }
  38.   if (%a) { mode %chan %a %b }
  39. }