mIRC Home    About    Download    Register    News    Help

Print Thread
Kick if on a spesific channel? #83675 21/05/04 11:58 AM
Joined: Mar 2003
Posts: 9
M
MaxeY Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Mar 2003
Posts: 9
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


---------------
As Far As I Know, there is one positive thing about life......

It ends... laugh
Re: Kick if on a spesific channel? #83676 21/05/04 12:25 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
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
}


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: Kick if on a spesific channel? #83677 21/05/04 12:29 PM
Joined: Mar 2003
Posts: 9
M
MaxeY Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Mar 2003
Posts: 9
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


---------------
As Far As I Know, there is one positive thing about life......

It ends... laugh