2014-07-04 7 views
0

이것은 꽤 긴 게시물 (특히 아래 코드)이므로 나와 함께 감내하십시오.mIRC Link Bot for 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 /^!(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 $+ 
} 

, 제대로 입력 명령 (! 즉 노래)하지 않습니다 텍스트를 표시하십시오. 사실, 아무 일도 일어나지 않습니다. 상충되는 것이 있습니까? 내가 한 일에 어떤 문제도 볼 수 없다. 이 두 세트의 스크립트 (두 개의 트 위치 채널 용)가 있습니다.

죄송합니다. 저는 MSL의 완벽한 초보자이고 포인터/팁이 필요합니다. 가장 엄격한 링크 보호를 설정하는 방법에 대한 지침을 주시면 감사하겠습니다. 즉, youtube 및 imgur를 제외한 모든 연결을 허용하지 마십시오.

감사합니다. 텍스트 스크립트에 다른

답변

0

첫 번째 (! 명령! 노래!을 footbal! 개조는) 다른 원격 파일에 있어야
u는 링크 보호 스크립트에 아무것도 일치하는 텍스트에 스크립트를 갖고 있기 때문에

시도해보기

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 . $& 
    ! 
} 
} 
} 
+0

감사합니다. @Sirius_Black! 이것은 더 잘 작동하는 것 같습니다. 이 $ 닉이 때 로봇이 자동으로 차단하는 작동 http://imgur.com/oDAwUjE : 만 약간의 문제는 $ 닉 $ + 대신 내가 권한을 부여하고있는 사람의 나에게 다시 참조 할 것이다 링크를 클릭하십시오.그러나 $ nick은 그 사람을 허용 할 때 제 이름을 말합니다. – vika09

+0

대신 $ nick to $$ 2로 변경하십시오.이 답변이 정답이면 감사합니다. –

+0

안녕하세요, @Sirius_Black, 어떤 이유로 링크 보호 봇이 mod/op (이름 : G1nge_UK)를 차단하려고 시도하고 있습니다. : http://www.imgur.com/4f7u3Js 또한 링크가 있습니다 : http://www.imgur.com/4f7u3Js 나에게 새로운 질문을 시작 하시겠습니까? – vika09