mIRC Homepage
Posted By: Scriptor Massive Voice Script - 17/02/05 11:23 PM
Well I'd like to have a masive voice script that actually works.

And what it is, that every time I go into a room I'm operator in it voices everybody. In any channel I join that I'm operator in. The ones I've made have been broken and stop working, or only work in one chanel.
Posted By: Online Re: Massive Voice Script - 18/02/05 12:01 AM
Put these scripts together in a remote file:

Code:
On !*:op:#:{
  if $opnick == $me { massmode v # }
}


Code:
; /massmode o|h|v [#channel]
;
; Gives the specified mode letter
; to those who don't have it.
 
alias massmode {
  var %chan = $iif($2 ischan, $2, #)
  if !$1 || !%chan { return }
  var %i = 1, %nicks
  while $nick(%chan, %i, a, $1) {
    %nicks = %nicks $ifmatch
    if $numtok(%nicks, 32) == $modespl {
      mode %chan + $+ $str($1, $modespl) %nicks
      %nicks =
    }
    inc %i
  }
  if $numtok(%nicks, 32) { 
    mode %chan + $+ $str($1, $ifmatch) %nicks
  }
}


To avoid the risk of flooding yourself off the server with this script, enable mIRC's flood protection under Alt+O >> IRC >> Flood and remember to tick the "Op commands" box.
Posted By: Scriptor Re: Massive Voice Script - 18/02/05 12:08 AM
bleh it's not working for me.
Posted By: Scriptor Re: Massive Voice Script - 18/02/05 12:23 AM
Oh never mind, wink thanks
Posted By: state Re: Massive Voice Script - 18/02/05 01:37 AM
/mv

mv {
%k.num = 0
%k.total = $nick(#,0)
%k.kick = 0
:loop
inc %k.num 1
if ( %k.num > %k.total ) { goto done }
elseif ( $nick(#,%k.num) == $me ) { goto loop }
else {
inc %k.kick 1
mode # +v $nick(#,%k.num)
goto loop
}
:done
unset %k.*
}
Posted By: Relinsquish Re: Massive Voice Script - 18/02/05 02:01 AM
That's a very bad way of doing it. Your script actually sets +v on each and every single person per command.

Instead of setting the modes like this:
+vvv Nick1 Nick2 Nick 3

It will set the modes like this:
+v Nick1
+v Nick2
+v Nick3

Using Online's way, the voices will be set all on one instance without flooding the room or yourself. smile

By the way, using /var and while loops would be quicker and cleaner. Thought I would just point some of these things out.
Posted By: LethPhaos Re: Massive Voice Script - 19/02/05 09:22 PM
Could anyone add something in the good script so that it doesn't revoice voiced people, and doesn't voice people who are opped (result: it should only change mode for people with no modes when running the script)
Posted By: Iori Re: Massive Voice Script - 20/02/05 08:38 AM
Try this (I didn't laugh)
Code:
; /massmode o|h|v [#channel]
;
; Gives the specified mode letter
; to those who don't have it.

alias massmode {
  var %chan = $iif($2 ischan,$2,#)
  if !$1 || !%chan { return }
  var %i = 1, %nicks, %a = $lf $+ $left($nickmode,$pos($nickmode,$1,1))
  while $nick(%chan,%i,a,%a) {
    %nicks = %nicks $v1
    if $numtok(%nicks, 32) == $modespl { mode %chan + $+ $str($1,$v1) %nicks | var %nicks }
    inc %i
  }
  if $numtok(%nicks, 32) { mode %chan + $+ $str($1,$v1) %nicks }
}
Posted By: LethPhaos Re: Massive Voice Script - 21/02/05 08:24 PM
Seems to work after a couple of little tests smile
Thanx!
© mIRC Discussion Forums