description : anti spammer ( update )
action : ban and kick target nick (if u were op and target nick were same channel with you)
this simple snippet trigger when somebody/some nick privmsg you with words "http.*" and "www."
just simply load it into your remote script.
credit to jethro_ and Napa182
on ^1:OPEN:?:*:if ($regex($1-,/(http:\/\/\w+|www\.\w+)/i)) { spamkick $nick }
alias spamkick {
var %sk $comchan($1,0)
while (%sk) {
if ($comchan($1,%sk).op) { if ($1 !isop $comchan($1,%sk)) { ban -k $comchan($1,%sk) $1 posibble inviter. } }
dec %sk
}
}
well.. thx for the comments guys really appreciated here..
Jethro_ yeah ive just starting to learn regex here.. basicly i can use "isin" operator. like if (www. isin $1-).. im still learing to use $regex.. but thanks ..
napa182: yeah /ban -k is very good idea im just figure it out.. thanks..
jonessy44 on next version maybe i`ll add a an asterisk () wildsite so any symbol following http like "http" so the script will be read more "flexible" .. thanks
You'd be buggered if someone just went "Hey dude check out this YouTube link! http://blabla.com" Nice idea, just not 100% worked through like :/Well, it's not as bad as "buggered" since it's designed for query or PM. Most users do link posting in the main channel. Furthermore, he can add an enable-and-disable switch for the script.
You'd be buggered if someone just went "Hey dude check out this YouTube link! http://blabla.com" Nice idea, just not 100% worked through like :/
Your regex is not really well constructed. You can use the /i flag to make it case insensitive. Also, your regex will match www........... followed by many dots and http..... followed by many characters after.
This one will only match http:// followed by domain names. That goes the same for www. followed by domain names:
if ($regex($1-,/(http:\/\/\w+|www\.\w+)/i))