@Jethro: I understand this, and if you take a closer look at my regex you will notice that http:// and www. are optional. I added them for speed purposes
@Turbiance, Here you go, an on/off version of my simple script:
alias LinkKick {
if ($isid) {
return $($+(%,LinkKick:,$chan),2)
}
elseif ($($+(%,LinkKick:,$chan),2)) {
unset $+(%,LinkKick:,$chan)
}
else {
set $+(%,LinkKick:,$chan) $true
}
}
menu Channel {
$iif($LinkKick,Disable,Enable) LinkKick:LinkKick-Toggle
}
on @*:text:*:#:{
if ($LinkKick) {
var %m = /(?:(?:https?:\/\/(?:www\.)?)|ftps?:\/\/|www\.)?\S+\.(?:[a-z]{2,4}|musuem)\b/iS
if ($regex($1-,%m)) {
ban -ku30 $chan $Nick 2 Please don't spam the channel.
}
}
}