mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2007
Posts: 37
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jun 2007
Posts: 37
Hi well, I'm in a room and when nicks like 'dgfdfh' join, someone has it in their script to ban it, something for random letters I guess like


* sgkjhj has joined #hellfire
* Linx sets mode: +b @AF934B2A.367A849A.B1CFD698.IP
* sgkjhj was kicked by Linx ( random drone/spambot detected )


Is there any code that can do the same for me?


Last edited by EffingHell; 03/07/07 06:37 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
yes, but it's not really simple, and it's not foolproof either.

What you need to do is look at the nick of the client that joined the channel, then see if there's a commonality (eg: all consonants or all vowels), then if there is, kick them from the channel

For the joining and kicking, check the help file under ON JOIN and /kick

For the nick recognition, I suspect this would be easier done with regex, so I'm going to pass that on to one of the excellent regex helpers here.

Joined: May 2007
Posts: 89
T
Babel fish
Offline
Babel fish
T
Joined: May 2007
Posts: 89
Well, the character recognition in the nickname could be done with or without regexp easily.

Here are the 2 methods I may propose:

Code:
Alias RecNrm {
  Var %w = $1 , %l = $len($1)
  Var %nc = $count(%w,b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,y,z)
  Var %p = $calc((%nc / %l) * 100)
  If (%p >= 95) { Return 1 }
  Else { Return 0 }
}

Alias RecReg {
  Var %w = $1 , %l = $len($1)
  Var %nc = $regex(%w,/([b-df-hj-np-tv-z])/gi)
  Var %p = $calc((%nc / %l) * 100)
  If (%p >= 95) { Return 1 }
  Else { Return 0 }
}


These 2 functions will locate if there is atleast 95% of consonants in a word.
I tried to be as 'clear' as possible.

Hoping it helps ...
^^


tropnul
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Originally Posted By: TropNul
These 2 functions will locate if there is atleast 95% of consonants in a word.


Cry, dry, fly, fry, pry, sky, try, wry.

There's plenty of words few or no vowels so it's not very reliable.

Joined: May 2007
Posts: 89
T
Babel fish
Offline
Babel fish
T
Joined: May 2007
Posts: 89
Then you must provide more conditions smile

Like: if LengthOfWord > 3
or: if LastCharacter != y
or: y as a vowel

I do not presume that it would be 100% reliable, but it tends to what was asked :s


tropnul
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In those words that you specified, y is being used as a vowel. It is the only letter in the English language which can be either a vowel or a consonant. There are no words in the English language that have no vowels.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
This code could be used to track similar nicknames:


Code:
on *:JOIN:#channel:{
  var %time = 20
  var %limit = 10
  ;
  var %mask = $regsubex($nick,/[a-z]/ig,L)
  %mask = $regsubex(%mask,/[0-9]/ig,N)
  %mask = $regsubex(%mask,/[^0-9a-z]/ig,S)
  ;
  hinc $+(-mu,%time) jflood $+($chan,.,%mask) 1
  if ($calc($hget(jflood,%mask) % %limit) == 0) {
    echo 4 -a Possible join-flood on $chan
    ;ban $chan $nick 2
    ;kick $chan $nick Join-Flood
  }
}

(untested)

Change the first two variables to match your channel requirements (flood limits).

-genius_at_work


Link Copied to Clipboard