mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Do you really want to ban for ".abc" ? :X

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Well, that being said, maybe an ideal script is for the op to set it and forget it...

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
I was pointing to your 2nd regex that would match a message like
Quote:
<PoorUser> ...why?
...an efficient method to stop both spam and chat together wink

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Ok how about this:
Code:
on *:TEXT:*:#: {
  var %x = (\x2Ecom|\x2Enet|\x2Eorg|\x2Einfo)$
  if ($regex($1-,/(?<=^| )((?>[a-zA-Z-0-9]{3,8}:\/\/|www\.)\S+)/g)) || ($regex($1-,%x)) {
    ban -k $chan $nick 2 Do not advertise!
  }
}

The main reason I added that is some spammers might say come to blah.com without www. or http://

Last edited by Tomao; 26/03/09 11:20 PM.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Originally Posted By: Tomao
The main reason I added that is some spammers might say come to blah.com without www. or http://
True. But without any www. OR http:// the OP could simply use one of the many badword scripts arround, And the original request was for a text-based url blacklist.
As I tested my code briefly I suppose he just missed something, e.g. I named the file "forbiddenurls.txt" instead of "urls.txt" to be not mistaken for urls.ini ... likely that I produced confusion by trying to prevent confusion frown

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
But does your script kick if I place just .com in urls.txt?

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Originally Posted By: Horstl
Put all forbidden "urls" inside a textfile named "forbiddenurls.txt" located in your mirc main directory, each on a separate line.
DON'T add the protocol like http:// or host (www.) there, start at the domain part. You may use wildcards.
So it *should* work for "*.com" - But that's not what I had in mind smile
For general wildcard matches I'd use a simple wildcard-badword script. And the read loop above was to keep it simple and .txt-based - $hfind(W|R) would be more efficient.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Quote:
So it *should* work for "*.com"

Ok, I see. Unfortunately it didn't work per your description. I jotted down *.com or *.com* or .com in forbiddenurls.txt
Nothing happened with your script. I understand you didn't consider that function in mind, but wouldn't it be better to adjust it that way to seek .com .net or .org extension?

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Erm, it does work, acc. to my description (?)
It doesn't ban for "something.com" but for "www.something.com" or "http://something.com". If you want to ban just for "*.com" you wouldn't need a protocol check at all, and it would be a (lousy) badword script, so why not use a good badword script instead, there are many out there. The downside is that you'd e.g. ban for quoting your $server too.

The script above checks all lines in the textfile against $regml(N)*, where $regml(N) is the text following any occurrence of www/http/https/ftp up to the next space char, that is: a link indicated by a www-host and/or protocol, but without this part, to make matching more versatile.
- If I want to ban "www.google.com" or "http://google.com" or "http://www.google.com", I'd add "google.com"
- If I want to ban all google, I'd add "google." or even "*google"
- If I want to ban "<whatever>.com" I'd add "*.com"

Finally, there are more top-level domains under the sun than *.com *.net and *.org smile

Joined: Mar 2009
Posts: 6
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Mar 2009
Posts: 6
Originally Posted By: Horstl
At trying my suggestion, did you
- put a file "forbiddenurls.txt" in the main directory of the mIRC serving as your bot ( //echo -a $mircdir in the bot client) // Yes I did

- add url entries to this file as described: without http or www or the like // What u mean ?

- replace "#YOURCHAN" in the code (2 instances) with the actual channel name or channel names // I did that too, I specified that channel

- make sure the bot running the script was @ in this channel

Last edited by mikkisofta; 03/04/09 01:51 PM.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Originally Posted By: mikkisofta
- add url entries to this file as described: without http or www or the like // What u mean ?

There are three examples in the initial post, and some more in my last post.
Quoting myself here:
Quote:
Put all forbidden "urls" inside a textfile named "forbiddenurls.txt" located in your mirc main directory, each on a separate line.
DON'T add the protocol like http:// or host (www.) there, start at the domain part. You may use wildcards.
Examples:
for "www.google.com" add: google.com
for "http://forums.mirc.com" add: forums.mirc.com

(...)

Example:
If you have e.g. in the textfile the line: test123.com
It will ban for messages:
"www.test123.com"
"Gratis testing? >http:[color:#33CC00]//www.[/color]test123.com<"
"check out http://test123.com/tests/something"

And here:
Quote:
- If I want to ban "www.google.com" or "http://google.com" or "http:[color:#FFFFFF]//www.[/color]google.com", I'd add "google.com"
- If I want to ban all google, I'd add "google." or even "*google"
- If I want to ban "<whatever>.com" I'd add "*.com"


/me running out of crayons... frown

Page 2 of 2 1 2

Link Copied to Clipboard