Jethro commented on a Page, Kick for posting link  -  Dec 04, 2011

Then your best bet is using regex:

on $*:text:/\.(?=com\b|net\b|org\b|ca\b|uk\b|tv\b|name\b)/iS:#:{
  kick # $nick 2 Whoa! $nick $+ , Don't Post links in here without permission from a mod.. Cya in 10 mins B)
}

This will make sure a text ends with URL domain name extensions specified.

Kranium31  -  Jan 31, 2014

Im using a modified version of this and it keeps timing out regardless if links are on or off.

Can you help find the problem?

on *:text:!links on:#:{
  %links = 1
  describe $chan Links Protection On.
}
on *:text:!links off:#:{
  %links = 0
  describe $chan Links Protection Off.
}

on $*:text:/\.(?=com\b|net\b|org\b|ca\b|uk\b|tv\b|name\b|www\b|http\b)/iS:#:{
  /describe # .timeout $nick Whoa! $nick $+ , Don't Post links in here without permission from a mod.. Cya in 10 mins B)
  }
Charlatan  -  Jul 14, 2015

Example:

on @!*:text:*:#:if (%Link. [ $+ [ # ] ] = yes) { Linkick $strip($1-) }
on @!*:action:*:#:if (%Link. [ $+ [ # ] ] = yes) { Linkick $strip($1-) }

alias -l Linkick {
  var %l = $strip($1-)
  if (@ isin %l) || ($regex(#,$nick)) || ($nick(#, $nick, '.@)) halt
;if ($regex(%l,/(https?|www|irc|ftp)$+[[:punct:]])/i) || ($regex(%l,/\.(com|net)$)/i) urlkick
  if ($regex(%l,/(https?|www|irc|ftp)(\:|\.)$)/i) || ($regex(%l,/\.(com|net)$)/i) urlkick
;elseif ($regex(%l,/(grupos|groups|chats)*(msn|buzzen|legion|vsixc)$)/i) message
  elseif ($regex(%l,/(gro?upo?s|chats)?(msn|buzzen|legion|vsixc)$)/i) message
  halt
}
menu channel {
-
Protection
.$Iif(%Link. [ $+ [ # ] ] == yes, $Style(1)) Spam Protection: {
    Set %Link. [ $+ [ # ] ] $Iif(%Link. [ $+ [ # ] ] == yes, no, yes)
    Echo -at * 0Spam Protection $Iif(%Link. [ $+ [ # ] ] == yes, Activated, Desactivated)
  }
}
-

Urlkick and messages are alias you can put whatever you want in that alias.
Next of ";" theres another syntaxis you can test it because I never come back to chat.
This is from my old script modify if you want it, this code dont kick if some one put a email ex: blahblaa@email.com

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.