Advertisement
westor

!permit addon for Aotik v1

Jan 17th, 2015
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.06 KB | None | 0 0
  1. on *:text:*:#:linkpost $1-
  2. on *:action:*:#:linkpost $1-
  3. on *:notice:*:#:linkpost $1-
  4. ON !*:PART:#: { if ($hfind(permit,$nick)) { hdel permit $nick } }
  5.  
  6. alias -l linkpost {
  7.   var %purge = /^!(link\so(n|ff)|(permit)|(permitoff)|(permitclear)|(permitlist))\b/iS
  8.   if (($regex($1-,%purge)) && ($regml(1) = permit) && ($nick isop #) && ($$2 ison #)) {
  9.     if ($hfind(permit,$2)) { msg # ( $+ $nick $+ ): The $qt($2) is already into the permitted list. | return }
  10.     hadd -m permit $2
  11.     notice $2 You can now post a link into the # channel. Starting now.
  12.     msg # ( $+ $2 $+ ): You can now post a link.
  13.   }
  14.   if (($regex($1-,%purge)) && ($regml(1) = permitoff) && ($nick isop #) && ($$2 ison #)) {
  15.     if (!$hfind(permit,$2)) { msg # ( $+ $nick $+ ): The $qt($2) is NOT into the permitted list. | return }
  16.     hdel permit $2
  17.     notice $2 You can NOT post anymore a link into the # channel. Stop now!
  18.     msg # ( $+ $2 $+ ): You can NOT anymore post a link!
  19.   }
  20.   if (($regex($1-,%purge)) && ($regml(1) = permitclear) && ($nick isop #)) {
  21.     if (!$hget(permit)) { msg # ( $+ $nick $+ ): The permitted list is empty! | return }
  22.     var %tot = $hget(permit,0).item
  23.     hfree permit
  24.     msg # ( $+ $nick $+ ): The permitted list have been cleared! - (Total: %tot $+ )
  25.   }
  26.   if (($regex($1-,%purge)) && ($regml(1) = permitlist) && ($nick isop #)) {
  27.     if (!$hget(permit)) { msg # ( $+ $nick $+ ): The permitted list is empty! | return }
  28.     var %tot = $hget(permit,0).item
  29.     msg # ( $+ $nick $+ ): The permitted list are %tot nicknames.
  30.   }
  31.   if (($regml(1) = link on) && ($nick isop #)) {
  32.     if (!$istok(%chanon1,#,32)) {
  33.       set %chanon1 $addtok(%chanon1,#,32)
  34.       msg # ( $+ $nick $+ ): Link Protection Is Now on in: #
  35.     }
  36.     else { msg # ( $+ $nick $+ ): Link protection is already on in # ! }
  37.   }
  38.   if (($regml(1) = link off) && ($nick isop #)) {
  39.     if ($istok(%chanon1,#,32)) {
  40.       set %chanon1 $remtok(%chanon1,#,1,32)
  41.       msg # ( $+ $nick $+ ): Link Protection Is Now off in: #
  42.     }
  43.     else { msg # ( $+ $nick $+ ): Link protection is already off in # ! }
  44.   }
  45.   if ($hfind(permit,$nick)) {
  46.     var %domain com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk
  47.     var %exception /https?:\/\/(?:w{3})?\.(youtube|imgur|ima|test)\.(ninja|eu|com)/
  48.     var %link /(?<=^|\s)((?>\S{3,5}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS
  49.     if ($findtok(%chanon1,#,1,32)) && ($nick !isop #) && ($regex($1-,%link)) && (!$regex($1-,%exception)) {
  50.       msg # ( $+ $nick $+ ): Ok you have post your permit link.
  51.       hdel permit $nick
  52.     }
  53.   }
  54.   elseif (!$hfind(permit,$nick)) {
  55.     var %domain com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk
  56.     var %exception /https?:\/\/(?:w{3})?\.(youtube|imgur|ima|test)\.(ninja|eu|com)/
  57.     var %link /(?<=^|\s)((?>\S{3,5}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS
  58.     if ($findtok(%chanon1,#,1,32)) && ($nick !isop #) && ($regex($1-,%link)) && (!$regex($1-,%exception)) {
  59.       msg # ( $+ $nick $+ ): You did not have permission to post a link ask a mod to !permit you
  60.       msg # /timeout $nick 1
  61.     }
  62.   }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement