mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2014
Posts: 6
X
Xelphos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
X
Joined: Jul 2014
Posts: 6
Ok, so I am working on a bot, and I want a link blocker for Twitch, now the link blocker works just fine, but.... Anyone can use the !permit command and post a link. I did add the ($nick isop $chan), but that did not help. Can someone take a look at this and help me figure it out?

Code:
on @*:text:*:#xelphos:linkpost $1- 
on @*:action:*:#xelphos:linkpost $1- 
on @*:notice:*:#xelphos:linkpost $1- 
alias -l linkpost { 
  if (!%p) && (!$hfind(permit,$nick)) { inc -u30 %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 %link /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS 
    if ($findtok(%chanon1,#,1,32)) && ($nick(#,$nick,vr)) && ($regex($1-,%link)) { 
      timeout # $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 ($nick isop $chan) && ($regex($1-,%purge)) && ($regml(1) = permit) && ($$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!
    }
  } 
}

Last edited by Xelphos; 14/07/14 12:48 AM.
Joined: Aug 2013
Posts: 22
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Aug 2013
Posts: 22
try this one out

Code:
on @*:text:*:#xelphos:linkpost $1- 
on @*:action:*:#xelphos:linkpost $1- 
on @*:notice:*:#xelphos:linkpost $1- 
alias -l linkpost { 
  if (!%p) && (!$hfind(permit,$nick)) { inc -u30 %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 %link /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS 
    if ($findtok(%chanon1,#,1,32)) && ($nick(#,$nick,vr)) && ($regex($1-,%link)) { 
      timeout # $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!
    }
  } 
}

Joined: Jul 2014
Posts: 6
X
Xelphos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
X
Joined: Jul 2014
Posts: 6
I figured it out.

Last edited by Xelphos; 14/07/14 03:06 PM.

Link Copied to Clipboard