mIRC Homepage
Posted By: Bespin74 How to block Chat Window spams - 20/09/04 07:23 PM
On Undernet, at times, we can receive about 1 chat window per minute. Mostly porn adverts. When they are too many chat windows, mirc start to become slow and don't respond anymore.

I created a timer for performing '/close -m' commands every 10 minutes... is there a better way to avoid this spam problem?
Posted By: alkahol1k Re: How to block Chat Window spams - 20/09/04 07:54 PM
type alt + r and put this in a seperate remote file:

on *:OPEN:*: {
if ( http isin $1- ) || ( htm isin $1- ) || ( /server isin $1- ) || ( film isin $1- ) || ( pics isin $1- ) || ( /decode isin $1- ) || ( html isin $1- ) || ( film isin $1- ) || ( pic isin $1- ) || ( com isin $1- ) || ( /j isin $1- ) || ( $chr(35) isin $1- ) || ( www isin $1- ) {
.ignore -u5 $nick 2 | close -m $nick | /echo -a M ass Advertising Detected On [ $nick ] | halt
}
}

replace the text before 'isin' with whatever u want ignored .

this should ignore the user for 5 seconds, and also close the window right after it opens.
Posted By: tidy_trax Re: How to block Chat Window spams - 20/09/04 08:09 PM
Code:
alias allow { 
  if (!$isid) {
    if ($1 == -a) { hadd -m allow $2 $2 } 
    if ($1 == -d) {
      if ($hget(allow,$2)) { hdel allow $2 }
    }
    elseif ($1 == -c) { 
      if ($hget(allow)) { .hfree allow }
    }
  }
  else { return $hget(allow,$1) }
}
on $^*:open:?:/(?:ftp:\/\/|https?:\/\/|www2?\.)[^<>\.\s]+(?:\.[^<>\.\s]+)+(?:\/[^<>\.\s]+)*|irc:\/\/[^<>\.\s]+(?:\.[^/<>\.\s]+)+(?:\/[^/<>\.\s]*)?\/?(?![^\s\x2c\.])|aim:goim\?screenname=[^\s&]+(?:&message=[^\s&=]+)?/:{ 
  if ($allow($nick) == $null) { halt }
}
on *:start:{
  if (!$hget(allow)) { 
    if ($isfile($scriptdirallow.hsh)) { hload allow " $+ $scriptdirallow.hsh" }
  }
}
on *:exit:{
  if ($hget(allow)) { hsave -o allow " $+ $scriptdirallow.hsh" }
}


The above will block pm's that have ftp, http(s), www(2), irc, or aim urls in them, there is also an allow list so that you can let some people send you urls.

/allow -a <nick> - add a nick to the allow list.
/allow -d <nick> - remove a nick from the allow list.
/allow -c - clear the allow list.

- Not tested.
Posted By: Bespin74 Re: How to block Chat Window spams - 21/09/04 11:33 PM
Thanks for these two remote scripts, I wil try them!
Posted By: tidy_trax Re: How to block Chat Window spams - 23/09/04 09:06 PM
I made a mistake, change:

Code:
on $^*:open:?:/(?:ftp:\/\/|https?:\/\/|www2?\.)[^&lt;&gt;\.\s]+(?:\.[^&lt;&gt;\.\s]+)+(?:\/[^&lt;&gt;\.\s]+)*|irc:\/\/[^&lt;&gt;\.\s]+(?:\.[^/&lt;&gt;\.\s]+)+(?:\/[^/&lt;&gt;\.\s]*)?\/?(?![^\s\x2c\.])|aim:goim\?screenname=[^\s&amp;]+(?:&amp;message=[^\s&amp;=]+)?/:{   
  if ($allow($nick) == $null) { halt }
}


To:

Code:
on $^*:open:?:{
  if ($regex($1-,/(?:ftp:\/\/|https?:\/\/|www2?\.)[^&lt;&gt;\.\s]+(?:\.[^&lt;&gt;\.\s]+)+(?:\/[^&lt;&gt;\.\s]+)*|irc:\/\/[^&lt;&gt;\.\s]+(?:\.[^/&lt;&gt;\.\s]+)+(?:\/[^/&lt;&gt;\.\s]*)?\/?(?![^\s\x2c\.])|aim:goim\?screenname=[^\s&amp;]+(?:&amp;message=[^\s&amp;=]+)?/S)) {   
    if ($allow($nick) == $null) { halt }
  }
}
© mIRC Discussion Forums