mIRC Home    About    Download    Register    News    Help

Print Thread
#156384 15/08/06 06:16 PM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
Hi

I'm wondering why this script doesn't work.
Code:
on *:kick:#:{
  if ($wildsite == $address($me,2)) { return }
  if ($me == $nick)  {
    var %x = $ialchan($address($knick,2),#,0)
    while (%x) {
      if ($wildsite == $ibl(#,%x)) {
        kick $chan $ialchan($address($knick,2),#,%x).nick You are banned
      }
      dec %x
    }
  }
}

As soon as I kick someone and his banmask (*!*@host.com) is already banned, the script should kick all the other clones from nick (if they exist).

#156385 15/08/06 09:47 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The problem is with your first if statement.
When you kick someone, then $wildsite would return your address, which is checked in the first if statement, and when true does a return. Therefore, your second if statement (and the rest of the code) never gets touched.

Do you want this code to work only when you kick, or when anyone kicks? Do you want it to work if you are kicked?

#156386 16/08/06 07:46 AM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
Hi RusselB

I actually want it to work only when I kick someone and it also shouldn't work if I get kicked.

#156387 16/08/06 06:33 PM
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi I have not tested this but this should work. or something along those lines

alias specialkick {
who #
VAR %i = 1
mode $1 +b $2
WHILE ($nick($$1,%i) != $null) {
IF ($2 iswm $ial($nick($$1,%i))) && ($nick != $me) {
kick $chan $nick($$1,%i)
}
INC %i
}
}

/specialkick (channel) (mask)

Last edited by HaleyJ; 16/08/06 07:28 PM.

Newbie
#156388 16/08/06 06:57 PM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
Thx HaleyJ for the code.
But isn't there another way not to use /who # ?
I'm in a big channel and sometimes I kick 2 or 3 users at the same time. So if everytime I use /who # I'll get flooded.

Btw.
Quote:
mode $1 +b $2

the script shouldn't ban the user as soon as he get kicked. I think you missunderstood sumth. It should only kick all the clones of the User, as soon as his banmask is already banned in the following format: e.g *!*@host.com ($address($nick,2))

#156389 16/08/06 07:06 PM
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Its needed to fill your IAL list up otherwise it may not work on some nicks, You can take out the who # and make another script that will who the channel whenever you join it.

ON *:JOIN:#: {
if ($nick == $me) {
who #
}
}

or use user levels to make that one line of code

ON +1000:JOIN:#: /who #

i am not sure on your last statement. Do you want to kick and not ban?


Newbie
#156390 16/08/06 07:09 PM
Joined: Aug 2006
Posts: 5
E
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
E
Joined: Aug 2006
Posts: 5
I think he means he wants to kick them IF they are already banned.

Perhaps you could use the isban operator?
Or maybe the On BAN event?

#156391 16/08/06 07:29 PM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
@Haley
I'm already using:

ON *:JOIN:#: {
if ($nick == $me) {
who #
}
}

@Ezdo
1. SHE! smile
2. u right ... it should kick the clones IF they're already banned.
3. Does there really exist a "isban" operator? I just thought it would also work like this: if ($address($knick,2) == $ibl(#,%i)) { kick the clones }

#156392 16/08/06 07:39 PM
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
UNTESTED

alias specialkick {
who #
VAR %i = 1
WHILE ($nick($$1,%i) != $null) {
if ($2 iswm $ibl(#,%i)) {
kick $chan $nick($$1,%i)
}
INC %i
}
}


Newbie
#156393 17/08/06 09:31 AM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
Hmm ... doesn't work

#156394 17/08/06 10:08 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Sorry I didn't post sooner, had trouble with my phone line and DSL service. Anyhow, I think this should work for what you're wanting
Code:
on me:*:kick:#:{
  if $knick != $me {
    var %x = $ialchan($address($knick,2),#,0)
    while (%x) {
      if ($wildsite == $ibl(#,%x)) {
        ban -k $chan $ialchan($address($knick,2),#,%x).nick You are banned
      }
      dec %x
    }
  }
}
  

#156395 18/08/06 10:10 AM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
Thank you very much RusselB! laugh


Link Copied to Clipboard