0

这是一个相当长的帖子(特别是下面的代码),所以请耐心等待。

在@Siris_Black 的帮助下,我设法让这件事发挥作用。

//LINK PROTECTION
    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|tv
        var %exception /(?:http?:\/\/)?w{3}\.(youtube|imgur|i.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 $+ , 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 $+ , Link Protection is already off . $&
            !
        }
      }
    }

但是,即使使用广泛的脚本,也存在一些问题:

被阻止的“白名单”链接

http://i.stack.imgur.com/Ww4rK.png

如您所见,Alexander_CJ 和 Psychosis06 发布了 Imgur 链接并超时(我有 BetterTwitchTV,所以我可以透露被清除的内容)。有什么我在这里设置错误的吗?

!permit 命令并不总是有效 似乎存在 permit 命令无法实际允许任何人的问题。主要问题是用户名(我发现:所有用户名都是小写的)。但是 !permit + username 命令似乎仍然存在问题。这里是否存在任何冲突?

链接脚本允许某些链接之前或之后有文本

这是不言自明的,在某些情况下,链接机器人允许链接似乎在其之后或之前具有正常文本。除非我没有正确设置规则,否则在某些情况下会出现问题。

链接保护似乎会干扰其他脚本

这些是我的其他脚本:

//Commands
on *:TEXT:!commands:#circon: { 
  if ((%floodcommands) || ($($+(%,floodcommands.,$nick),2))) { return }
  set -u5 %floodcommands On
  set -u15 %floodcommands. $+ $nick On
  msg $chan /me Currently available commands (place a '!' before the word) - donate|song|mods. Please don't spam commands. $+
}

//Song
on *:TEXT:!song:#circon: { 
  if ((%floodsong) || ($($+(%,floodsong.,$nick),2))) { return }
  set -u5 %floodsong On
  set -u15 %floodsong. $+ $nick On
  msg $chan /me You can find Circon's songs here, wait for the song to finish and it will be the last played song: http://grooveshark.com/#!/circonflexes/listens $+
}

//Soccer Link
on *:TEXT:!football:#circon:{
  if ((%floodfootball) || ($($+(%,floodfootball.,$nick),2))) { return }
  set -u5 %floodfootball On
  set -u15 %floodfootball. $+ $nick On
  msg $chan /me Circon is watching the World Cup here!: <LINK> $+
} 

//Mods Link
on *:TEXT:!mods:#circon:{
  if ((%floodmods) || ($($+(%,floodmods.,$nick),2))) { return }
  set -u5 %floodmods On
  set -u15 %floodmods. $+ $nick On
  msg $chan /me Circon's mods are here: http://youtu.be/N-IHaIKQvns. Servercross2 Recticle add-on - https://www.dropbox.com/s/dkd0b1fqp9oaz2e/ServerCross2.rar Dont forget to virus scan before use. :) $+
}

//Donate
on *:TEXT:!donate:#circon:{
  if ((%flooddonate) || ($($+(%,flooddonate.,$nick),2))) { return }
  set -u5 %flooddonate On
  set -u15 %flooddonate. $+ $nick On
  msg $chan /me Please donate to Circon here: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KRQXH2YM3WGSW $+
}

偶尔,正确输入的命令(即!song)不会显示文本。事实上,什么也没有发生。有什么矛盾的吗?我看不到我所做的任何问题。这些脚本有两组(用于两个 Twitch 频道)。

很抱歉,这很多。我是 MSL 的新手,只需要一些指针/提示。我主要感谢有关设置最严格链接保护的任何指导 - 即禁止除 youtube 和 imgur 之外的任何链接。

谢谢!

4

1 回答 1

0

首先,另一个文本脚本(!command,!song,!footbal,!mods)需要在另一个远程文件中
,因为你有一个文本脚本与链接保护脚本上的任何内容相匹配

尝试这个

on @*:text:*:#:linkpost $1-
on @*:action:*:#:linkpost $1-
on @*:notice:*:#:linkpost $1-
alias -l linkpost {
if (!$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|tv
var %exception /(?:http?:\/\/)?(?:w{3}\.)?.+(youtube|\Qimgur\E)\.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 # $$2 $+ , 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 $+ , 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 $+ , Link Protection is already off . $&
    !
}
}
}
于 2014-07-05T02:03:11.927 回答