mIRC链接机器人的Twitch



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

在@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 /^!(linkso(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 . $&
            !
        }
      }
    }

然而,即使使用了大量的脚本,也存在一些问题:

被屏蔽的"白名单"链接

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

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

!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以外的任何链接。

谢谢!

首先,另一个文本脚本(!command,!song,! football,!mods)需要在另一个远程文件
因为你有一个与链接保护脚本匹配的文本脚本

试试这个

on @*:text:*:#:linkpost $1-
on @*:action:*:#:linkpost $1-
on @*:notice:*:#:linkpost $1-
alias -l linkpost {
if (!$hfind(permit,$nick)) {
var %purge /^!(linkso(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|QimgurE).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 . $&
    !
}
}
}

最新更新