Ive been doodling with this link protection for a while. They seem inconsistent and although the code looks good, it doesn't always do what it's supposed to do.

So, i decided to write my very first script from scratch i'm sure there's someone who can tell me how to merge the 'domain pods' into a single pod for a cleaner look, but for now, i'm after a way to implement a strike system. (higher punishment for more links posted).
=================================================================================================================================

So far the code looks like this:



on *:text:!linkson:#: {
if ($nick isop #) {
if (%links) { msg $chan Link protection is already active }
else {
msg $chan Link protection activated
set %links On
}
}
}

on *:text:!linksoff:#: {
if ($nick isop #) {
if (%links) {
msg $chan Link protection deactivated
unset %links On
}
else { msg $chan Link protection is already disabled. }
}
}
on *:text:*.com*:#: {
if ($nick isop #) { return }
if ($istok(%permit,$nick,32)) { return }
if (%links) {
msg $chan /timeout $nick 10
msg $chan please ask permission before posting a link, $nick [Link] [Warning]
}
}

on *:text:*.net*:#: {
if ($nick isop #) { return }
if ($istok(%permit,$nick,32)) { return }
if (%links) {
msg $chan /timeout $nick 10
msg $chan please ask permission before posting a link, $nick [Link] [Warning]
}
}
on *:text:*.nl*:#: {
if ($nick isop #) { return }
if ($istok(%permit,$nick,32)) { return }
if (%links) {
msg $chan /timeout $nick 10
msg $chan please ask permission before posting a link, $nick [Link] [Warning]
}
}
on *:text:*.tv*:#: {
if ($nick isop #) { return }
if ($istok(%permit,$nick,32)) { return }
if (%links) {
msg $chan /timeout $nick 10
msg $chan please ask permission before posting a link, $nick [Link] [Warning]
}
}

on *:text:*http://*:#: {
if ($nick isop #) { return }
if ($istok(%permit,$nick,32)) { return }
if (%links) {
msg $chan /timeout $nick 10
msg $chan please ask permission before posting a link, $nick [Link] [Warning]
}
}
on *:text:*www.*:#: {
if ($nick isop #) { return }
if ($istok(%permit,$nick,32)) { return }
if (%links) {
msg $chan /timeout $nick 10
msg $chan please ask permission before posting a link, $nick [Link] [Warning]
}
}

on *:text:!permit*:#: {
if ($nick isop #) {
if (%links) {
set -u30 %permit $addtok(%permit,$2,32)
msg $chan You have 30 seconds to post a link, $nick
}
}
}

Last edited by Khonor; 13/08/14 07:55 PM.