mIRC Homepage
Posted By: shinjii Can mirc determine between number or letter - 11/03/04 02:47 PM
im trying to devalop a script to combat a huge lot of dornes that are hitting my channel of late.

however the script im trying to do auto bans on a 5 char nick having the 1st char a letter and the following 4 a number and ban only on that instance found. BUt i cant find anywhere in the coding that can do that, so any help or suggestions would be appreciated.
here's two different ones, i'm not sure which is faster:
Code:
on *!:join:#:{
if $regex($nick,/^[a-zA-Z]{1}[0-9]{4}$/) { ban -k # $nick die drone! }
}  

Code:
on *!:join:#:{
if $left($nick,1) !isnum && $right($nick,-1) isnum 1000-9999 { ban -k # $nick die drone! }
}
ohh of course .. *kicks himself* i forgot about regex gee so obvious now *g*
ok .. this next one i have absolutely no clue how to deal with. These drones are 9 char nicks but r random in there number of letters an numbers and i have no way of dealing with them, without banning all 9 char nicks, which is very drastic.

eg of Nicks are..

u7uyt1nfd
ff0pgc5o5

And other varieties of rndmness
check if there's a similarity in the addresses
sadly address vary so much an so widely, that isnt an option, although i wish it was
Quote:
drones are 9 char nicks but r random in there number of letters an numbers

Consider this pattern then, /^[a-z0-9]{9}$/

Other points to keep in mind...
- Do they always have a tilde ~ in their ident?
- Is their ident or real name always in the same length?
- Any similarity between their nicks and idents?
- Any similarity between their realname and nicks and/or idents?
- Does their host always appear as a numeric, unresloved IP?

If the answer to any of these question is yes, please paste us a small log with WHO or WHOIS output of these bots and we might come up with a tighter way of identifying them.

Good luck laugh
Quote:
Consider this pattern then, /^[a-z0-9]{9}$/

that will also match an innocent nickname, such as: online101
* Online shrugs

He really needs a tighter condition crazy
A much tighter condition an dunf there's about a 50/50 variation between those with ~ and those with out, there just so randm other then the fact there 9 chars in total length and use rndm mix of letters an numbers there so far isnt any real pattern.
Other points to keep in mind...
- Is their ident or real name always in the same length?
ident yes .. real name no

- Any similarity between their nicks and idents?
none at all .. completly both rndm combo of numbers + letters

- Any similarity between their realname and nicks and/or idents?
Nope afraid not

- Does their host always appear as a numeric, unresloved IP?
some do some dont, more dont then do
1 Lot of Drones actually have 5 numbers in there real name slot..

demiray is ~hqksha@ip104-105.cbn.net.id * 12632

Like Above .. not always ~ though but guranteed to have 5 numbers there each time.
Quote:
demiray is ~hqksha@ip104-105.cbn.net.id * 12632

But this one does not have 9 chars in its nick... is it a new type of drone?

Please paste more logs if you can.
that is a different sort of drone compared to the 9 char rndm nicked ones. im just wondering the practicallity of having the Numeric ones mentioned as an mIRC script or would it be better as a tcl script ?
mIRC is flexible enough to do what you want; you already saw it can operate $regex quite nicely. The question is, how are you going to detect those drones? We can't give a definite answer to that before we examine logs of their whois output.

You can also check if they have a unique response to any kind of CTCP request such as PING, VERSION, TIME or FINGER.
The only distinguishing factor about this lot is the fact there real name contains 5 Numbers .. so im guessing th eonly way to find a user that has a relname on join with 5 numbers is a whois ... but sadly im not good at scripting.

But so far only thing about these ones is the 5 numbers as there rela name.
Try this script:
  • On !*:join:#channel:{
    hadd -mu20 who $nick 1
    who $nick
    }

    raw 352:*:{
    ;
    ; Event Format:
    ; mynick * identd host server nick H/G hops realname
    ;
    if $hget(who,$6) {
    haltdef
    if $9- isnum 10000-99999 {
    ban -k #channel $6 2 drones are not welcome
    }
    }
    }

    raw 315:*:{
    ;
    ; Event Format:
    ; mynick nick End of /WHO list.
    ;
    if $hget(who,$2) {
    haltdef
    hdel who $2
    }
    }
If you don't understand what a specific command does, check the help file: /help /command. A list of IRC numerics is available here.
© mIRC Discussion Forums