|
|
Morgan7456
|
Morgan7456
|
I tried to write the following script but when I tried to test it, mirc crashes. is there something wrong with it or is there something wrong with mirc?
on *:nick:{
if *666* iswm $newnick {
var %i = i
var %x = $comchan($newnick,1)
while (%x) {
if $me isop %x { ban -k %x $newnick 2 testing }
inc %i
%x = $comchan($newnick,%i)
}
}
}
|
|
|
|
Joined: Jun 2003
Posts: 4,670
Hoopy frood
|
Hoopy frood
Joined: Jun 2003
Posts: 4,670 |
Nothing's wrong with your mIRC, but your while loop would cause it to crash  Try: on !*:NICK:{ if (*666* iswm $newnick) { var %i = 0 while (%i < $comchan($newnick,0)) { inc %i ban -ku60 $comchan($newnick,%i) $newnick 2 Testing } } }Regards,
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
on !*:nick:{
if (666 isin $newnick) {
var %i = 1
while (%i <= $comchan($newnick,0)) {
if ($comchan($newnick,%i).op) { ban -k $comchan($newnick,%i) $newnick 2 testing }
inc %i
}
}
}
|
|
|
|
Morgan7456
|
Morgan7456
|
is there a way to ban only the nickname and not the IP address? 
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
Remove the 2 before 'testing'.
|
|
|
|
Morgan7456
|
Morgan7456
|
well that didn't work either:
[13:14] * Morgan sets mode: +b herbz666!*Herbster@E6E243FF.BDE2038E.565FF36F.IP
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
I forgot that /ban does a /userhost on the user before banning them, you'll have to use: mode $comchan($newnick,%i) +b $newnick
kick $comchan($newnick,%i) $newnick testing.
|
|
|
|
Morgan7456
|
Morgan7456
|
thanks it worked! 
|
|
|
|
Joined: Mar 2004
Posts: 358
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 358 |
usually you can halt the script thats making your mirc freeze up with ctrl+break
|
|
|
|
ricky_knuckles
|
ricky_knuckles
|
or /break providing you can type it you should definitly familiarize yourself with breaking loops before trying to use while
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
You can't type /break since mIRC is busy looping infinitely.
/break is an mirc command that can be used within a script in a while loop, but does not provide the same functionality as ctrl+break does.
|
|
|
|
ricky_knuckles
|
ricky_knuckles
|
or type /break providing you can
ive broken loops with /break like once but ive done it
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
Impossible. See for yourself: //while 1 { } You can type /break as many times as you want  Btw before you say "it was other code"...an infinite loop is an infinite loop, doesn't matter what code caused it.
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
Sorry, but that's not possible. mIRC doesn't display keyboard input in the middle of a loop, nor does it interpret scripts other than that in the middle of the loop.
See for yourself:
1. type //while 1 { } 2. type /break (Don't press enter) 3. wait for about a second 4. hit ctrl+break
The second mIRC displays "* Break: command halted" /break will show up in the editbox.
|
|
|
|
|
|