mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2007
Posts: 20
D
Drai Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2007
Posts: 20
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

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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
  }
}


Joined: Nov 2007
Posts: 20
D
Drai Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2007
Posts: 20
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?

Last edited by Drai; 13/09/09 05:51 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
No. Most channel modes are set to a specific person. The one exception that I can think of quickly is the ban mode.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
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.

Joined: Jul 2008
Posts: 236
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
/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
}

Last edited by s00p; 22/09/09 06:08 PM.
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Just so you know sOOp, you can write a local variable thus:

var %x = 1, %v = $+(-,$str(v,$chanmodes)), %str


Link Copied to Clipboard