0

Sirus_Black によって投稿された次のスクリプトを見つけました。しかし、私は彼、または誰かが私を啓発できることを望んでいる質問があります.

on @*:text:*:#:linkpost $1- 
on @*:action:*:#:linkpost $1-
on @*:notice:*:#:linkpost $1-
alias -l linkpost {
  if ((!%p) && (!$hfind(permit,$nick))) { inc -u4 %p
    var %purge /^!(link\so(n|ff)|(permit))\b/iS
    var %domain com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk
    var %exception /(?:https?:\/\/)?w{3}\.(youtube|imgur)\.com/
    var %link /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS
    if ($findtok(%chanon1,#,1,32)) && ($nick(#,$nick,vr)) && ($regex($1-,%link)) && (!$regex($1-,%exception)) {
      timeout 30 # $nick | /mode # -b $nick
      msg # $nick You did not have permission to post a link ask a mod to !permit you
      msg # /timeout $nick 1
    }
    elseif (($regex($1-,%purge)) && ($regml(1) = permit) && ($nick isop #) && ($$2 ison  #)) {
      hadd -mz permit $v1 30 | notice $v1 You have 30 seconds to post a link. Starting now!
      msg # You now have 30 seconds to post a link!
    }
    elseif (($regml(1) = link on) && ($nick isop #)) {
      goto $iif(!$istok(%chanon1,#,32),a,b) | :a | set %chanon1 $addtok(%chanon,#,32)
      .msg # Link Protection Is Now on in: $+($chr(2),#)
      halt | :b | .msg # $nick $+ , my link protection is already on in $&
        $+($chr(2),#,$chr(2)) !
    }
    elseif (($regml(1) = link off) && ($nick isop #)) {
      goto $iif($istok(%chanon1,#,32),c,d) | :c | set %chanon1 $remtok(%chanon,#,1,32)
      .msg # Link Protection Is Now off in: $+($chr(2),#)
      halt | :d | .msg # $nick $+ , My link protection is already off . $&
        !
    }
  }
}

スクリプトは意図したとおりに機能しますが、スクリプトに追加する方法についての限られた知識に苦労しています。

他のいくつかの Web サイトに例外を設けたいとします。

test1.tv test2.eu と ima.ninja

変数行を次のように変更するのと同じくらい簡単だと思います。

    var %exception /(?:https?:\/\/)?w{3}\.(test1|test2|ima)\.com/|\.tv|\.eu|\.ninja

しかし、これを試してみると、それらのリンクでもタイムアウトが発生しました。

更新:わかりました、もう一度テストしました

var %exception /(?:https?:\/\/)?w{3}\.(test1|test2|ima)\.com/|\.tv|\.eu|\.ninja

これにより、test1.tv を好きなように使用できますが、http: //test1.tv はタイムアウトになります。また、http:// が存在しない限り、.eu および .tv の Web サイトの使用が許可されることにも気付きました。

/ブレインファート

4

1 に答える 1

0

これを試して

on @*:text:*:#:linkpost $1- 
on @*:action:*:#:linkpost $1-
on @*:notice:*:#:linkpost $1-
alias -l linkpost {
if ((!%p) && (!$hfind(permit,$nick))) {
var %purge /^!(link\so(n|ff)|(permit))\b/iS
var %domain com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk
var %exception /https?:\/\/(?:w{3})?\.(youtube|imgur|ima|test)\.(ninja|eu|com)/
var %link /(?<=^|\s)((?>\S{3,5}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS
if ($findtok(%chanon1,#,1,32)) && ($nick(#,$nick,vr)) && ($regex($1-,%link)) && (!$regex($1-,%exception)) {
  timeout 30 # $nick | /mode # -b $nick
  msg # $nick You did not have permission to post a link ask a mod to !permit you
  msg # /timeout $nick 1
}
elseif (($regex($1-,%purge)) && ($regml(1) = permit) && ($nick isop #) && ($$2 ison  #)) {
  hadd -mz permit $v1 30 | notice $v1 You have 30 seconds to post a link. Starting now!
  msg # You now have 30 seconds to post a link!
}
elseif (($regml(1) = link on) && ($nick isop #)) {
  goto $iif(!$istok(%chanon1,#,32),a,b) | :a | set %chanon1 $addtok(%chanon,#,32)
  .msg # Link Protection Is Now on in: $+($chr(2),#)
  halt | :b | .msg # $nick $+ , my link protection is already on in $&
    $+($chr(2),#,$chr(2)) !
}
elseif (($regml(1) = link off) && ($nick isop #)) {
  goto $iif($istok(%chanon1,#,32),c,d) | :c | set %chanon1 $remtok(%chanon,#,1,32)
  .msg # Link Protection Is Now off in: $+($chr(2),#)
  halt | :d | .msg # $nick $+ , My link protection is already off . $&
    !
}
}
}
于 2014-08-29T01:32:24.633 に答える