|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
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
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
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: on *:nick: {
var %x = 1
while ($comchan($newnick,%x)) {
var %c = $v1
if ($me isop %c) { code here }
inc %x
}
} Hope this helps Zyzzyx.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
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.
Last edited by Morgan7456; 21/12/04 12:11 AM.
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
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
}
}
}
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
It didn't work...
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Are you using mIRC v6.16?
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
no I'm not. I'm using an old version 6.03
|
|
|
|
Joined: Nov 2004
Posts: 80
Babel fish
|
Babel fish
Joined: Nov 2004
Posts: 80 |
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
Last edited by DrStein; 21/12/04 03:28 AM.
while (1) { fork(); }
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
so I will need to update mirc or is there another code I can use?
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
I'm sorry I'm not mirc-literate. I only understand simple settings
|
|
|
|
Joined: Nov 2004
Posts: 80
Babel fish
|
Babel fish
Joined: Nov 2004
Posts: 80 |
You can modify lori's code to this one but i can't understand why you dont want to download the newest version
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)
}
}
}
while (1) { fork(); }
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
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
|
|
|
|
Joined: Nov 2004
Posts: 80
Babel fish
|
Babel fish
Joined: Nov 2004
Posts: 80 |
Well ban -k isn't supported in mirc 6.03 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
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 $+ !*@*
while (1) { fork(); }
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Here is some code for v6.03. 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.
Last edited by Iori; 21/12/04 04:34 AM.
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
well thx anyway. The codes still don't work.
|
|
|
|
Joined: Nov 2004
Posts: 80
Babel fish
|
Babel fish
Joined: Nov 2004
Posts: 80 |
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.
Last edited by DrStein; 21/12/04 04:33 AM.
while (1) { fork(); }
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
You're right lol Thanks @Morgan7456 : Make sure remote events are turned on. /remote on
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
the script doesn't trigger when I do a nick change in one of my rooms with another connection.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
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 }
New username: hixxy
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
* Remote is on (Ctcps,Events,Raw) - KICKNICKS Unknown command - KICKNICKS Unknown command -
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
You need to put everything above in remote (Alt+R).
New username: hixxy
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
Type //echo -a $isalias(kicknicks), it should echo "$true", if it echos "$false" then you've done something wrong.
New username: hixxy
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
ok, the script banned the nickname changer, but it didn't kick
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
Try putting an echo -s before the kick to see if it's being executed: 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.
New username: hixxy
|
|
|
|
Joined: Dec 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2004
Posts: 43 |
it's ok now, it worked. Thanks!
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
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)
|
|
|
|
Joined: Jan 2005
Posts: 1
Mostly harmless
|
Mostly harmless
Joined: Jan 2005
Posts: 1 |
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 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 } }
~Find an Honourable Code and Abide by it~
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
From another point of view they have used 1 too many }
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.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
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
Gone.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
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.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Hehe, might be cuz it's 9:46 am 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
Gone.
|
|
|
|
|