mIRC Homepage
Posted By: sigbin help... - 21/12/05 06:06 PM
can anyone make this.. detect newly joins nicks then if the first letter of the nick is CAPS and the last 2 characters are numbers of the newly joined nick... they will be kicked out... im using it for the virus drones... they keep on entering channels....
Posted By: HAMM3R Re: help... - 21/12/05 06:35 PM
Hmm. Im not experienced with regex, which may be hekpfull here. But this should work just fine...
Code:
on @*:join:#chan: { if (($left($nick,1) isupper) && ($right($nick,2) isnum)) { kick $chan $nick Virus } }

Good luck.
Posted By: sigbin Re: help... - 21/12/05 06:45 PM
thankz... it doesnt detect a CAPS first letter... it must detect first capital leter
Posted By: HAMM3R Re: help... - 21/12/05 07:06 PM
It should, infact it does for me. I tested it. Are you sure you changed #chan to your actual channel?

Code:
on @*:join:[color:blue]#chan[/color]: { if (($left($nick,1) isupper) && ($right($nick,2) isnum)) { kick $chan $nick Virus } }[/color]


Make sure to change #chan to the actual channel name you want the script to run on.
Posted By: sigbin Re: help... - 21/12/05 07:34 PM
yes... i change the #chan... heres the result...

Quote:
`dryice19 was kicked by sigbin Suspected Virus-Drone


the script should detect capital first letter... and can it be possible that it will kick once... even if the same nick has joined the channel
Posted By: synth7 Re: help... - 21/12/05 07:46 PM
Try this...

Code:
on @*JOIN:[color:red]#channel[/color]: {
  if ($left($nick,1) isupper) && ($mid($nick,2,2) isnum) {
    kick $chan Suspected Virus-Drone
  }
}
Posted By: MikeChat Re: help... - 21/12/05 09:32 PM
I think you just need to add to your script "isalpha"
Code:
on @*JOIN:#channel: {

  if ($left($nick,1) isalpha) &&  ($left($nick,1) isupper) && ($mid($nick,2,2) isnum) {

    kick $chan Suspected Virus-Drone

  }

}
Posted By: HAMM3R Re: help... - 21/12/05 10:43 PM
I dont see how that's neccessary, considering there is no way for a number to be lower or upper case. The help file says:

Quote:
isupper - text contains only upper case letters


So im really not sure why it's not working. Like i said, it works fine for me.

Also, both synth7's and MikeChat's scripts are missing the $nick in the kick command. Should be: kick $chan $nick Suspected Virus-Drone.

EDIT #2: Ok Mike, now I see what you mean. Since in the user's quote the knick had a ` in front of it, i guess that could complicate things. blush So yes, the isalpha is needed. Just remember to fix the kick command like i said above. Sorry about that Mike.
Posted By: synth7 Re: help... - 21/12/05 10:49 PM
Oh well. He apparently added it before because it kicked ok, just kicked the wrong people.
Posted By: HAMM3R Re: help... - 21/12/05 10:49 PM
I just edited my post. Look above.
Posted By: FiberOPtics Re: help... - 21/12/05 10:59 PM
on @*:join:#chan: if ($regex($nick,/^[A-Z].++(?<=\d\d)/)) ban -k # $nick 2 Bad nick.

If you prefer something shorter, but slightly less efficient in theory (you wouldn't notice it at all in this case) you can use:

$regex($nick,/^[A-Z].*\d\d$/)
Posted By: HAMM3R Re: help... - 21/12/05 11:03 PM
lol i knew that was coming. just a matter of time.
Posted By: synth7 Re: help... - 21/12/05 11:08 PM
I can bang my hands on my keyboard randomly too, Fiber.
Posted By: HAMM3R Re: help... - 21/12/05 11:10 PM
rofl. that's exactly what it looks like. one of these days ill read a tutorial on regex. looks like neat stuff, although a bit intimidating.
Posted By: sigbin Re: help... - 21/12/05 11:54 PM
thankz guys... how about making it kick a user with the same nick only once.... in using it also for a warning... some irc chatters use nicks like once virus drone use... so i want it to kick only once... so i will not kick flood the channel...
Posted By: MikeChat Re: help... - 22/12/05 01:22 AM
heck could have had "kick the dog" and I would have missed it, I was focused on his matchtext

but, as usual, FiberOptics gets the better version

"Scripties, now with Regex in Every Byte"
So remember, Sweeten your code with Regex Today!

Man I have been watching way too much TV...... smile
Posted By: genius_at_work Re: help... - 22/12/05 01:43 AM
Learn Regex Here!

-genius_at_work
Posted By: sigbin Re: help... - 22/12/05 03:31 AM
how can i make it kick the user once... like when its not a drone... it wont rejoin... like one kick only for one nick...
Posted By: HAMM3R Re: help... - 22/12/05 04:15 AM
Code:
on @*:join:#chan: { if (($regex($nick,/^[A-Z].++(?&lt;=\d\d)/)) &amp;&amp; ($nick !isin %vk)) { ban -k # $nick 2 Bad nick. | set %vk %vk $nick } }
Posted By: sigbin Re: help... - 22/12/05 04:39 AM
thankz man... its a really great help...
© mIRC Discussion Forums