mIRC Home    About    Download    Register    News    Help

Print Thread
[HELP] Links Protection #247580 13/08/14 06:38 PM
Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2014
Posts: 77
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.
Re: [HELP] Links Protection [Re: Khonor] #247687 20/08/14 09:13 PM
Joined: Aug 2014
Posts: 3
F
fncwill Offline
Self-satisified door
Offline
Self-satisified door
F
Joined: Aug 2014
Posts: 3
Try the following script , I dont have time amt to go into detail , but it warns , kicks , and bans the user based on how many times they post a link , will update with more info , or ask if you can't figure it out .


Here are the commands :
!links on
!permit
!links off

Code:

on *:text:!links*:#: {
  if ($nick isop #) {
    if ($2 == on) {
      if (%links) { msg # Link protection is already enabled }
      else {
        msg # Link protection enabled
        set %links On
        return
      }
    }
    if ($2 == off) {
      if (%links) {
        msg # Link protection disabled
        unset %links on
        return
      }
      else { msg # Link protection is already disabled }
    }
    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 +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 ($nick isop #) { return }
  if ($nick == chingy1337) { 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-) {
      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
    }
  }
} 	


Re: [HELP] Links Protection [Re: fncwill] #247755 25/08/14 12:22 PM
Joined: Mar 2014
Posts: 42
S
Sjoepele Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Mar 2014
Posts: 42
These scripts both look VERY familiar :P

The second script is a little borked by the way. the timed messages to remove a certain userlevel from a user dont work and i forgot to add a 'return' somewhere so it'll give 2 responses when activating the link protection when its already enabled :P

to fix the double messages use the script i posted in the comments of my topic on hawkee: http://hawkee.com/snippet/10278/

Last edited by Sjoepele; 25/08/14 01:03 PM.