Removes Links that people post.
On/off '!link on' / '!link off'
and to let someone post a link do.
'!permit you' person has 30 seconds to post a link.
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 %link /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS
if ($findtok(%chanon,#,1,32)) && ($nick(#,$nick,vr)) && ($regex($1-,%link)) {
kick # $nick | /mode # -b $nick
msg # $nick You did not have permission to post a link ask a mod to !permit you
}
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!
}
elseif (($regml(1) = link on) && ($nick isop #)) {
goto $iif(!$istok(%chanon,#,32),a,b) | :a | set %chanon $addtok(%chanon,#,32)
.msg # My 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(%chanon,#,32),c,d) | :c | set %chanon $remtok(%chanon,#,1,32)
.msg # My Link Protection Is Now off in: $+($chr(2),#)
halt | :d | .msg # $nick $+ , My link protection is already off . $&
!
}
}
}
Ok, so I took a look at the code and modifyed it myself. Now I want it to only react to links like: ".google.com|..com|..|www..|www.google.***" Any suggestions? Been struggling a lot, but haven't found the answer.
I want it to react only to such links. All 5 combinations. And it should not react to the links without "*"s.
Ideas, suggestions, codes, all highly appreciated.
I know it's about these lines. How domake work?
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