mIRC Homepage
Posted By: Drai Auto-Devoice someone when they join - 13/09/09 05:09 AM
on @*:JOIN:#: {
if ($nick == that_person) {
mode $chan -v $nick
}
}

This isn't working. Basically, I'd like to make it so they're automatically devoiced when they join the channel. I am an operator there and have permission to do this, I just don't know how.

Thanks
Posted By: RusselB Re: Auto-Devoice someone when they join - 13/09/09 05:32 AM
Since a person can not join a channel already voiced, I recommend using this instead.
Code:
on @*:voice:#: {
  if ($vnick == that_person) {
    mode $chan -v $vnick
  }
}

Posted By: Drai Re: Auto-Devoice someone when they join - 13/09/09 05:36 AM
Originally Posted By: RusselB
Since a person can not join a channel already voiced, I recommend using this instead.
Code:
on @*:voice:#: {
  if ($vnick == that_person) {
    mode $chan -v $vnick
  }
}



Doesn't seem to be working. The nick is definitely correct.

Edit: It works if I take out the @

Thanks smile

Oh, is there a way I can apply it to the hostmask?
Posted By: RusselB Re: Auto-Devoice someone when they join - 13/09/09 06:43 AM
No. Most channel modes are set to a specific person. The one exception that I can think of quickly is the ban mode.
Posted By: Tomao Re: Auto-Devoice someone when they join - 13/09/09 07:31 AM
Originally Posted By: Drai
Oh, is there a way I can apply it to the hostmask?
You can use mirc's auto-voice list dialog to store hostmasks, and then use this little code:
Code:
on @*:JOIN:#: {
  if ($avoice($fulladdress)) { mode $chan -v $nick }
}
In other words, you borrow mirc's auto-voice feature in conjunction with devoicing users.

To do that, go to mirc address book -> control tab -> see a drop-down box -> slide it down to "voice" -> don't tick the enable box or random dely op/voice -> click add -> and you put all the hostmasks there and then ok to save in nick!user@host format.

After you've done that, every time a user joins in, the script I've shown you above will check if the hostmask in the auto-voice dialog matches, and if it does, it'll devoice that user when he or she joins.
Posted By: 5618 Re: Auto-Devoice someone when they join - 13/09/09 11:09 AM
Originally Posted By: Drai

Oh, is there a way I can apply it to the hostmask?

Like was set, you can't devoice a hostmask directly. However, you can simply check if a voiced nick matches a certain hostmask and if it does, devoice it.
Code:
if ($address($vnick,2) == *@host)

See /help $mask for different hostmask types.
Posted By: s00p Re: Auto-Devoice someone when they join - 22/09/09 06:02 PM
/help $address -- choose the second one.

Code:
; usage /devoice_host #chan nick!user@host
; nick!user@host may contain wildchars.
alias devoice_host {
  var %x = 1
  var %v = $+(-,$str(v,$chanmodes))
  var %str = $null

  while ($ialchan($2,$1,%x).nick) {
    %str = %str $v1
    if (%x % $chanmodes == 0) {
      mode $1 %v %str
      %str = $null
    }
    inc %x
  }

  mode $1 %v %str
}
Posted By: DJ_Sol Re: Auto-Devoice someone when they join - 22/09/09 06:12 PM
Just so you know sOOp, you can write a local variable thus:

var %x = 1, %v = $+(-,$str(v,$chanmodes)), %str
© mIRC Discussion Forums