mIRC Homepage
Posted By: Er1C Two channels - Get voice in channel2 if... - 22/09/05 06:43 PM
Hi!

I'm looking for a little script. This is the situation.

Two channels on the same server.
If a user is in #1, he get's voice in #2. When he leaves #1, his voice will be removed in #2. That's all.

Is this possible? Maybe there is already a script made for this?

I searched first and tried but cannot find what we are looking for.

Thanks in advance.
Code:
on 1:join:#Channel2:{
  if ( $nick ison #Channel1 && $me isop #Channel2 ) { mode #Channel2 +v $nick }
}

on 1:part:#Channel1:{
  if ( $nick ison #Channel2 && $nick isvoice #Channel2 && $me isop #Channel2 ) { mode #Channel2 -v $nick }
}
Code:
on *:join:*: {
  if ($me !isop [color:red]#chan2[/color]) { return }
  if ($chan == [color:red]#chan1[/color]) {
    if ($nick ison [color:red]#chan2[/color] && $nick isreg [color:red]#chan2[/color]) {
      mode [color:red]#chan2[/color] +v $nick
    }
  }
  elseif ($chan == [color:red]#chan2[/color]) {
    if ($nick ison [color:red]#chan1[/color] && $nick isreg $chan) {
      mode $chan +v $nick
    }
  }
}
on *:part:[color:red]#chan1[/color]: {
  if ($me !isop [color:red]#chan2[/color]) { return }
  if ($nick ison [color:red]#chan2[/color] && $nick isvoice [color:red]#chan2[/color]) {
    mode [color:red]#chan2[/color] -v $nick
  }
}


This requires you to be in both channels. You'll also need to be opped in order to voice/devoice the person.

Replace #chan1 with the channel you want people to be in.
Replace #chan2 with the channel the person will get voiced/devoiced in.

Any questions, just ask.

EDIT: Well, I was beat. laugh

Anyhow, this is the same basic script as above, except it checks if you're opped, it won't bother voicing someone who's an op or already voiced, and it will voice the person regardless which channel is joined first.
Posted By: Er1C Re: Two channels - Get voice in channel2 if... - 22/09/05 07:26 PM
works smoothly !
© mIRC Discussion Forums