mIRC Homepage

Kick if on a spesific channel?

Posted By: MaxeY

Kick if on a spesific channel? - 21/05/04 11:58 AM

Hi guys! I've been having some trouble with a little script. Say that a guy is in a channel we dont like (let's call it #porn), and he joins my channel. I want to check if he's on that channel, and then kick/ban him from my channel if he is.
Here's the one I'm using. Not actually 100% on this :S

raw 319:*:{ set $1- %channels | halt }
on *:JOIN:#mychan:{
if ($nick == $me) { halt }
.whois $nick
if (#porn isin %channels) {
.echo # $nick is a member of #porn
.ban $nick
.kick # $nick Brukere av #porn er ikke ønsket her...
}
halt
unset %channels
}

Any help would be great! smile
Posted By: LocutusofBorg

Re: Kick if on a spesific channel? - 21/05/04 12:25 PM

You got your sequence wrong. You're assuming %channels already has a value way before it is given one.

Code:
[color:green]; the @ makes sure you're opped (can't kick if you're not anyway)[/color]
[color:green]; at the same time it also prevents from triggering when you join, thus saving if statements[/color]
on @*:JOIN:#mychannel: whois $nick
[color:green]; raw 319 catches the channels info[/color]
raw 319:*: {
  if (#porn isin $2-) ban -k #mychannel $2 3 get lost
}
Posted By: MaxeY

Re: Kick if on a spesific channel? - 21/05/04 12:29 PM

aaah! i see. Thanks a lot! really helped my day smile Got lots of users joining my channel looking for apps and stuff... Thanks a bunch! laugh
© 2020 mIRC Discussion Forums