mIRC Homepage
Posted By: Justin_F Devoicing Certain names - 03/02/07 09:54 PM
Well iv been having problems with people coming into my channel under someones else nick. We try to take action by devoicing them and making them ID so chanvserv can revoice.

Heres what I plan on doing and wonder if it possible.
1. I wana make a script that looks for a certain part of a $nick. For instance if the nick is "[8_boo_8]" i want my script to look for the "[8_" part of the nick and take action.
Examples..
Script should take action is nick is like...
[8_boo_322]
[8_sddsdsd
etc..

I was wondering if a on join command is the best for this? Here is what I have so far.

Code:
on *:join:#: {
 if ($nick == *[8_* || *[[8_* ) {
mode $chan -v $nick
mode $chan +m
.notice $nick Please ID to receive a voice!
msg $chan $nick has be devoiced due to suspicious activity.
ifelse { halt }
}


The only part I think i muffed up is the "If" part, idk how to make it look for a certain part of a name. And how do I add more like "[8_", "[[8_" etc..
Posted By: Justin_F Re: Devoicing Certain names - 03/02/07 10:27 PM
I have found that
Code:
on *:join:#: {
  if ($nick == [8_) {
    mode $chan -v $nick
    mode $chan +m
    .notice $nick Please ID to receive a voice!
    msg $chan $nick has be devoiced due to suspicious activity!!!
    msg $chan $nick has be devoiced due to suspicious activity!!!
    msg $chan $nick is not the real user unless he/she is ID and Chanserved for a VOICE!
    ifelse { halt }
  }
}

Works but only if the person is called "[8_" lol, how do I make it work if "[8_" is any part of a persons nick?
Posted By: LonDart Re: Devoicing Certain names - 03/02/07 10:37 PM

Code:
if ([8_* iswm $nick) 


Untested


Also, remove the line "ifelse {halt}"
It is quite unneccesary, and it is also a non-existant command. I'm surprised it doesn't generate an error.


--------------------
LonDart
Posted By: Justin_F Re: Devoicing Certain names - 03/02/07 10:54 PM
tyvm. And ill fix that halt.
Posted By: LonDart Re: Devoicing Certain names - 03/02/07 10:55 PM
Sorry. That's not quite what you wanted.

If you want to check any nick that has [8_ anywhere in it, use:

Code:
if ( *[8_* iswm $nick )


If you only want to check nicks that begin with either [8_ OR [[8_ , then:

Code:
if (( [8_* iswm $nick ) || ( [[8_* iswm $nick ))



--------------------
LonDart
© mIRC Discussion Forums