Can't seem to figure it out, here is what I have so far...

Code:
on *:text:!links *:#: {
  if ($nick isop #) {
    if ($2 == on) {
      if (%links) {
        msg # Link protection is already enabled
        return
      }
      else {
        msg # Link protection enabled
        set %links $+ $chan On
        return
      }
    }
    if ($2 == off) {
      if (%links) {
        msg # Link protection disabled
        unset %links $+ $chan Off
        return
      }
      else {
        msg # Link protection is already disabled
        return
      }
    }
    else { msg # ' $+ $2 $+ ' is not a valid function. use '!links on' to enable link protection and '!links off' to disable it again. }
  }
}

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, $2
    }
  }
}
on *:text:!addreg *:#: {
  if ($nick isop #) {
    var %m = $read($chan $+ regulars.txt,ns,$2)
    if (!%m) { .write $chan $+ regulars.txt $2 | msg $chan $2 was successfully to the regulars list. | return }
    else { .msg $chan $2 is already in the regulars list. }
  }
}

on +201:text:*:#: {
  if ($nick isop #) { return }
  if ($istok(%permit,$nick,32)) { return }
  if (%links) {
    if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) {
      .timer3 off | /ruser 201 $nick
      msg # /timeout $nick 86400
      msg # That was your 3rd link. Try again tomorrow, $nick [Link] [24h]
      return
    }
  }
}
on +200:text:*:#: {
  if ($nick isop #) { return }
  if ($istok(%permit,$nick,32)) { return }
  if (%links) {
    if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) {
      .timer2 off | .auser 201 $nick | /timer3 1 3600 .ruser 200 $nick
      msg # /timeout $nick
      msg # No links without permission, $nick $+ ! [Link] [Timeout]
      return
    }
  }
}
on *:text:*:#: {
  if (%links) {
    if ($nick isop #) { return }
    if ($nick == nightbot) { return }
    if ($nick == moobot) { return }
    if ($nick == wizebot) { return }
    if ($read($chan $+ regulars.txt,nw,$nick)) { return }
    if ($istok(%permit,$nick,32)) { return }
    if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) {
      msg $chan /timeout $nick 10
      msg $chan Please ask permission before posting a link, $nick [Link] [Warning]
      .auser 200 $nick | /timer2 1 3600 .ruser $nick
      return
    }
  }
} 




Last edited by powerade661; 25/07/15 05:57 PM.