Here is an effective url blocker so when someone posts a link into you're chat, it will kick them [Obviously bot must be a mod]
on @*:text:*:#:{
if ( $nick isop $chan ) {halt}
var %b 1, %c *www.* *http://* *.com* *.net* *.tk* *.us* *.co* *.gov* *.org*
while $gettok(%c,%b,32) {
if $wildtok($1-,$v1,0,32) {
ban -ku30 # $nick 2 You've been kicked for posting a link.
}
inc %b
}
}
jaytea, how about getting the point out in the open? You always have a tendency to explain a subject with jargon and roundabout wording. I'm not attempting to offend your intelligence or anything. Don't steer me wrong. You're one of the brightest MSL scripters, but please bear in mind that not every Hawkee member uses English as his or her first language. Let's not make the explanation harder than it already has been.
How does that work?
it doesn't.
appending one line of code to another uses 3 bytes in the average case, ('command1 | command2') and 1 byte in the case where the command follows a brace ('{ command'), or indeed a brace follows a command.
splitting a line of code over multiple lines always uses at least 2 bytes (CRLF) + 2 spaces of indentation for every new level of brace depth, generally totaling >= 4b.
it should go without saying that this does not mean you should avoid using new lines ;)
AmytiX, $vnick and $opnick can only be used in conjunction with the voice and op event. You can't use them under a text event and expect them to be excluded.
You should either use:
if ($nick isop $chan) { halt }
if ($nick isvoice $chan) { halt }
Or:
if ($nick($chan,@%)) {
Or:
if ($nick($chan,oh)) {
You should use the iswm operator like Burrito said...or isin will do it too.
Hmm Nice ;)
Why you don't add somthing to don't kick ops and voices people . You can use also this :
on *:text:*:#:{
if ($opnick == $nick) { halt }
if ($vnick == $nick) { halt }
if ($me isop $chan) {
if ($1 == *www*) { kick $chan $nick has been kicked }
if ($1 == *http://*) { kick $chan $nick has been kicked }
if ($1 == *.com) { kick $chan $nick has been kicked }
if ($1 == *.net) { kick $chan $nick has been kicked }
}
}
This is very simple Snippet, But I like very much snippet of Jethro_ & Wader ;)
looking at some regex or as its proper name Regular Expressions will really help scripting in many languages as its pretty much a language on its own and is used in many different areas including php, .net, java, msl, etc.
http://gnosis.cx/publish/programming/regular_expressions.html
Chances are they'll keep on coming back after being kicked.
I believe regex will work best for detecting a URL with one line, but if you don't know regex, you can do it with $wildtok and a loop like this:
on @*:text:*:#:{
var %b 1, %c *www.* *http://* *.com* *.net* *.tk* *.us* *.co* *.gov* *.org*
while $gettok(%c,%b,32) {
if $wildtok($1-,$v1,0,32) {
ban -ku30 # $nick 2 You've been kicked for posting a link.
}
inc %b
}
}
This will ban them for 30 seconds and kick the offender.
Your approach of using one text event per routine is rather repetitive, and the remote size will get a lot bigger than you think when you decide to add more over time.
Under the ban -ku30 line.