This is alittle snippet for ops in the rooms that like to protect against spamming urls. You have the option of adding urls you wish to alow into a text file via a menu in the channel
#url off
on @*:text:*:#: {
if ($nick isreg $chan) {
if ($wildtok($strip($1-),*www.*.*,0,32)) {
var %a $wildtok($strip($1-),*www.*.*,0,32), %b $strip($1-)
while (%a) {
if (!$read(urls.txt,w,$+(*,$wildtok(%b,*www.*.*,%a,32),*))) {
hinc -u20 webspam $address($nick,5)
if ($hget(webspam,$address($nick,5)) == 5) { msg $chan $+($chr(2),$chr(3),4,[,$chr(2),$chr(3),15,$nick,$chr(2),$chr(3),4,],$chr(2),$chr(3),9,$chr(32),Please refrain from spamming unauthorized urls. Further infactions will result in a break from the room.) | halt }
elseif ($hget(webspam,$address($nick,5)) == 9) { hadd webspam $address($nick,5) 9 | kick $chan $nick Spamming Unauthorized Urls. | halt }
elseif ($hget(webspam,$address($nick,5)) == 12) { hdel webspam $address($nick,5) | ban -ku18000 $chan $nick 3 Banned: Spamming Unauthorized Urls. | halt }
}
else { dec %a }
}
}
}
}
#url end
on *:start: { hmake webspam 100 }
on *:exit: { hfree webspam }
menu channel {
-
Url Spam Protection
.$iif($group(#url) == on,Protection [On],Protection [Off]) { if ($group(#url) == on) { .disable #url | echo 12 -ae Url Protection :Off: } | else { .enable #url | echo 12 -ae Url Protection :On: } }
.-
.Add Allowed Url { var %x $$?="enter url:" | if (!$read(urls.txt,w,$+(*,%x,*))) { write urls.txt %x | echo 12 -ae Added %x to allowed URL list. } | else { echo 4 -ae Error - %x already exists in URL file } }
.Delete Allowed Url { var %x $$?="enter url:" | if ($read(urls.txt,w,$+(*,%x,*))) { write urls.txt -dl $+ $readn | echo 12 -ae Deleted %x from allowed URL list } | else { echo 4 -ae Error - %x does not exist in the URL file } }
-
}
By entering www.blah.com for example, it will kick for http://www.blah.com or www.blah.com
You may need to add another one for url starting with http://url
oh... the issue link was a http://url here .. there was no www. in the link
other wise yeah it works
I don't know what you have done, but by using mirc's highlight feature, along with the $highlight identifier in the on text event as shown above, it works perfectly for me:> I invite you to visit www.hawkee.com
Cheiron, you can advantage of mirc's highlight feature to match text or urls typed in channel.
1) go to address book (alt+B)
2) click on the Highlight tab
3) click on the Add button
4) Once the Add Highlight dialog pops up, fill in the word you want to match in the box. (if the matching words you fill in are of wildcard, put it as: TextorLinkHere (with * on both sides)
Let's say you fill in a word go. The highlight will match a sentence containing go, but not going. With wildcard, it will match.
Then you add another one via the add button, resuming the same process.
5) To Match on, drop it down to Message. (It should already be message)
6) don't choose any color.
7) Ok to finish.
on @*:TEXT:*:#: {
if ($highlight($1-)) {
kick $chan $nick No spamming!
}
}
well checking for a channel is much easier you can use this simple alias to find an channel name in a line of text: alias chancheck { if ($regex(channel,$1-,/(#[a-z0-9]{1,100})/ig)) { if ($v1 > 1) { var %chan# $v1, %chanout | while (%chan#) { %chan_out = $addtok(%chanout,$regml(channel,%chan#,44) | dec %chan_# } | return %chan_out } | else { return $regml(channel,1) } } }