mIRC Homepage
Posted By: Morgan7456 nick change kick/ban? - 20/12/04 11:43 PM
Hi all

I was wondering how I can kick/ban someone when they change their nick to a certain nickname. I would say it is something similar to a bad nickname kick/ban script, but I'm only looking to do this for 1 nickname only. Currently, I have written a script that didn't work:

on 1:NICK:{ if $newnick == test123 } /mode # +b $nick | .timer 1 1 /kick # $newnick You are in my PERMANENT Ban On Sight List }

if anyone can help me with my mistakes, I'd greatly appreciate it! thanks confused
Posted By: Zyzzyx26 Re: nick change kick/ban? - 21/12/04 12:02 AM
On a ON Nick event there is no # or $chan, since it's a global event. You'd have to loop through all the $comchan's to perform the actions. Something like:
Code:
on *:nick: {
  var %x = 1
  while ($comchan($newnick,%x)) {
    var %c = $v1
    if ($me isop %c) { code here }
    inc %x
  }
}

Hope this helps smile
Zyzzyx.
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 12:06 AM
so there's no way I can boot the user who changes their nickname in the channel? I'm confused

I have tried
on 1:NICK:/describe $newnick thinks $nick was a nicer nickname!

according to the MIRC help guide, and that didn't work either.
Posted By: Iori Re: nick change kick/ban? - 21/12/04 12:25 AM
Code:
on *:nick:{
  if $newnick == [color:blue]test123[/color] {
    var %i = 1
    while $comchan($newnick,%i) {
      if $me isop $v1 { ban -k $v2 $newnick 2 You are in my PERMANENT Ban On Sight List }
      inc %i
    }
  }
}
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 12:29 AM
It didn't work... frown
Posted By: Iori Re: nick change kick/ban? - 21/12/04 12:49 AM
Are you using mIRC v6.16?
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 02:50 AM
no I'm not. I'm using an old version 6.03
Posted By: DrStein Re: nick change kick/ban? - 21/12/04 03:24 AM
That's the problem then.

$v1 and $v2 can be used only with mirc 6.16

You can either download the newest version or put a variable inside the while loop to store $comchan($newnick,%i) and replace $v1 , $v2 with the variable
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 03:29 AM
so I will need to update mirc or is there another code I can use?
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 03:43 AM
I'm sorry I'm not mirc-literate. I only understand simple settings
Posted By: DrStein Re: nick change kick/ban? - 21/12/04 04:01 AM
You can modify lori's code to this one but i can't understand why you dont want to download the newest version confused

Code:
on *:nick:{ 
  if $newnick == test123 {    
    var %i = 1    
    var %x = $comchan($newnick,1)
    while (%x) {      
      if $me isop %x { ban -k %x $newnick 2 You are in my PERMANENT Ban On Sight List }  
      inc %i   
      %x = $comchan($newnick,%i)   
    } 
  }
}
  
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 04:10 AM
the code didn't work. It's ok. No biggie. The reason why I wanted this code is because we have an annoying chatter that joins our room oftenly. I already have him on my auto kick/ban list. However, he figured out a way to get in with another nickname and he changes it to his regular nickname.

I have talked to the server administrator, but they can't put him on kline due to his use of proxies. but thx anyway
Posted By: DrStein Re: nick change kick/ban? - 21/12/04 04:23 AM
Well ban -k isn't supported in mirc 6.03 blush
So you have to make 1 command for the ban and one for the kick :tongue:

if $me isop %x { ban -k %x $newnick 2 You are in my PERMANENT Ban On Sight List }

delete this and type
Code:
 
if $me isop %x { 
  ban %x $newnick 2
  kick %x $newnick <kick reason> 
}
 

Also you can set a ban only on "nick" (not on host or ip) and the user will be able to join again if he/she changes the nick
ban %x $newnick $+ !*@*
Posted By: Iori Re: nick change kick/ban? - 21/12/04 04:24 AM
Here is some code for v6.03.
Code:
on *:nick:{
  if $newnick == test123 {
    var %i = 1,%c
    while $comchan($newnick,%i) {
      %c = $ifmatch
      if $me isop %c { ban %c $newnick 2 | kick %c $newnick You are in my PERMANENT Ban On Sight List }
      inc %i
    }
  }
}

It really is a good idea to update your mIRC though. New versions fix bugs, some serious, as well as adding new features. smile
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 04:28 AM
well thx anyway. The codes still don't work. crazy
Posted By: DrStein Re: nick change kick/ban? - 21/12/04 04:33 AM
Lori has forgotten $newnick in: kick %c You are in my PERMANENT Ban On Sight List }

So if you just add $newnick after %c ( kick %c $newnick You are in my PERMANENT Ban On Sight List } )
i don't see any other reason why his code doesn't work.

If you add $newnick and still doesn't work ,type the error message.
Posted By: Iori Re: nick change kick/ban? - 21/12/04 04:36 AM
You're right lol Thanks smile

@Morgan7456 : Make sure remote events are turned on. /remote on
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 04:37 AM
the script doesn't trigger when I do a nick change in one of my rooms with another connection.
Posted By: tidy_trax Re: nick change kick/ban? - 21/12/04 01:41 PM
Code:
alias kicknicks {
  if ($$1 == [color:blue]test123[/color]) {
    var %i = 1
    while ($comchan($1,%i)) {
      if ($comchan($1,%i).op) { 
        ban $comchan($1,%i) $1 2
        kick $comchan($1,%i) $1 You are in my PERMANENT Ban On Sight List
      }
      inc %i
    }
  }
}
on *:nick:{ scon -at1 kicknicks $newnick }
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 10:44 PM
* Remote is on (Ctcps,Events,Raw)
-
KICKNICKS Unknown command
-
KICKNICKS Unknown command
-
confused
Posted By: tidy_trax Re: nick change kick/ban? - 21/12/04 10:48 PM
You need to put everything above in remote (Alt+R).
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 10:52 PM
it is in my remote
Posted By: tidy_trax Re: nick change kick/ban? - 21/12/04 10:56 PM
Type //echo -a $isalias(kicknicks), it should echo "$true", if it echos "$false" then you've done something wrong.
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 11:02 PM
$true
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 11:04 PM
ok, the script banned the nickname changer, but it didn't kick crazy
Posted By: tidy_trax Re: nick change kick/ban? - 21/12/04 11:07 PM
Try putting an echo -s before the kick to see if it's being executed:

Code:
echo -s kick $comchan($1,%i) $1 You are in my PERMANENT Ban On Sight List


If it's working then you should see an echo in your status window.
Posted By: Morgan7456 Re: nick change kick/ban? - 21/12/04 11:10 PM
it's ok now, it worked. Thanks! grin
Posted By: DaveC Re: nick change kick/ban? - 22/12/04 08:10 AM
copy his code from above it well work the alias kicknicks is right there.

Copy the code then paste it into wordpad
Then copy it from wordpad and paste it into the remotes section of mirc
(this fixes the code from coming out all on one line in mirc)
Posted By: Lord_Dragoon Re: nick change kick/ban? - 01/01/05 10:10 AM
Quote:
Hi all

I was wondering how I can kick/ban someone when they change their nick to a certain nickname. I would say it is something similar to a bad nickname kick/ban script, but I'm only looking to do this for 1 nickname only. Currently, I have written a script that didn't work:

on 1:NICK:{ if $newnick == test123 } /mode # +b $nick | .timer 1 1 /kick # $newnick You are in my PERMANENT Ban On Sight List }

if anyone can help me with my mistakes, I'd greatly appreciate it! thanks confused


The reason why this Script Never worked was because you used the { } Brackets instead of the () Brackets
It should have Look like the Following:

on *:NICK:{
if ( $newnick == test123 ) { /mode $chan +b $nick | .timer 1 1 /kick $chan $newnick You are in my PERMANENT Ban On Sight List }
}
smile
Posted By: SladeKraven Re: nick change kick/ban? - 12/01/05 08:08 AM
From another point of view they have used 1 too many }
Code:
on 1:NICK:{ 
if $newnick == test123 [color:red]}[/color] /mode # +b $nick | .timer 1 1 /kick # $newnick You are in my PERMANENT Ban On Sight List 
}

You don't need to use parentheses.
Posted By: FiberOPtics Re: nick change kick/ban? - 12/01/05 08:32 AM
Lord Dragoon's last post showed correct usage of braces. Btw you put the wrong brace, should be {
and you forgot an ending brace } to go with that.

Cya andy
Posted By: SladeKraven Re: nick change kick/ban? - 12/01/05 08:39 AM
Quote:

Lord Dragoon's last post showed correct usage of braces. Btw you put the wrong brace, should be {
and you forgot an ending brace } to go with that.


I was showing that they didn't need parentheses. I was also showing where they used too many } brace not where they should put one sorry for not being clear. smile
Posted By: FiberOPtics Re: nick change kick/ban? - 12/01/05 08:48 AM
Hehe, might be cuz it's 9:46 am wink

Anyway, I suppose it might be better to just show the right usage, as you got me, I thought you put it there on purpose, and made it red to highlight the fact it should be there.

Nvm smile
© mIRC Discussion Forums