mIRC Home    About    Download    Register    News    Help

Print Thread
Mass Modes #83411 18/05/04 10:53 PM
Joined: Apr 2004
Posts: 27
P
parvez Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2004
Posts: 27
hey can someone tell the codes for Mass Command
I only want Mass Op,Voice,devoice,deop,unban
thats all!

I use this for mass kill,kill,ban
Code:
 alias masskick {
  unset %total
  set %count.nick 1
  set %total $nick(#,0)
  :start
  inc %count.nick
  if (%count.nick > %total) { halt }
  if ($nick(#,%count.nick) == $me) { goto start }
  else { kick # $nick(#,%count.nick) 12[14[0,4 MASS 14,0]12] | goto start }
}  

Re: Mass Modes #83412 19/05/04 01:43 AM
Joined: Dec 2002
Posts: 208
C
Cobra Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
here are 2 different methods for doing it .. i couldnt deside which i liked best ...

Code:
massmode {
  ; * Usage: /massmode +/-ov [#chan]
  tokenize 32 $1 $iif($2 ischan, $2, $active)
  var %s = $iif($left($1,1) == +,1), %m = $right($1,-1)
  var %len = %modespl, %nicklist, %nick
  var %ctr = 0, %tot = $iif(%s, $nick($2,0,a,%m), $nick($2,0,%m))
  while (%ctr < %tot) {
    inc %ctr | var %nick = $iif(%s, $nick($2,%ctr,a,%m), $nick($2,%ctr,%m))
    %nicklist = %nicklist %nick
    if ($numtok(%nicklist,32) = %len) {
      mode $2 $+($iif(%s,+,-),$str(%m,%len)) %nicklist
      var %nicklist
    }
  }
  if (%nicklist) { mode $2 $+($iif(%s,+,-),$str(%m,$numtok(%nicklist,32))) %nicklist }
}

massmode2 {
  ; * Usage: /massmode +/-ov [#chan]
  tokenize 32 $1 $iif($2 ischan, $2, $active)
  var %s = $iif($left($1,1) == +,1), %m = $right($1,-1)
  var %len = $modespl, %nicklist, %nick
  var %ctr = 0, %tot = $iif(%s, $nick($2,0,a,%m), $nick($2,0,%m))
  while (%ctr < %tot) {
    inc %ctr | var %nick = $iif(%s, $nick($2,%ctr,a,%m), $nick($2,%ctr,%m))
    var %nicklist = %nicklist %nick
  }
  var %ctr = 1, %tot = $numtok(%nicklist,32)
  while (%ctr <= %tot) {
    var %range = $+(%ctr,-,$calc(%ctr * %len)) | inc %ctr %len
    mode $2 $+($iif(%s,+,-),$str(%m,%len)) $gettok(%nicklist,%range,32)
  }
}


basicly it loops though each person that doesnt match your desired outcome .. so if your doing /massmode +o for example
it will loop though $nick(#chan,N,a,o) (all nicks except ops)
all non ops in other words

but if your doing say -v
it loops though $nick(#chan,N,v) (all voices)

trather than looping though EVERYONE if they need it or not. (this will help prevent flood offs

notice that i use $modespl for %len (the length for each mode command) .. $modespl returns the limit the server alows for mode commands if specified in raw 005, however for some odd reason if u wish to change it u can simply replace $modespl with 6 .. or 4 .. or whatever u wish.

the difference between the first one and the 2nd one is that the first one sets the modes as it gets enough nicks to do so, while its still collecting nicks .. the 2nd one simply collects all nicks, then loops though and sets all modes .. it realy doesnt mater which u use.

if u have any questions about this code feel free to ask.

it should work with any +/-o,v,h,u (not all networks suport +h and +u)

Cobra^

Re: Mass Modes #83413 19/05/04 01:45 AM
Joined: Dec 2002
Posts: 208
C
Cobra Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
an after thought .. if u use that code to mass -o and it deops yourself before it gets though the list u could get some errors .. also iit doesnt automaticly check to see if your +o before it trys seting modes .. but those are simple enough things to edit in i asume u can take care of it, if not let me know ...

Cobra^

Re: Mass Modes #83414 19/05/04 02:19 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Small typo: %modespl should be $modespl in /massmode smile


New username: hixxy
Re: Mass Modes #83415 19/05/04 02:37 AM
Joined: Dec 2002
Posts: 208
C
Cobra Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
yep, good eye smile

thanks

Cobra^

Re: Mass Modes #83416 19/05/04 07:56 PM
Joined: Nov 2003
Posts: 30
N
Nicon Offline
Ameglian cow
Offline
Ameglian cow
N
Joined: Nov 2003
Posts: 30
in alias

ma {
%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
echo %Channel 15[14 $+ $time(hh:nn) $+ 15] 14 - address.. 14 $+ $nick(#,%k.num) 15(14 $+ $address($nick(#,%k.num),1) $+ 15)
goto loop
}
:done
unset %k.*
}

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.*
}
mdv {
%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.*
}
mop {
%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 # +o $nick(#,%k.num)
goto loop
}
:done
unset %k.*
}
mdp {
%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 # -o $nick(#,%k.num)
goto loop
}
:done
unset %k.*
}
mk {
%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
raw -q kick # $nick(#,%k.num) Users has been kicked, reason: %kick.msg $+ 
goto loop
}
:done
unset %k.*
unset %kick.msg
}
mb {
%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
ban # $nick(#,%k.num) 2
goto loop
}
:done
unset %k.*
}
mkb {
%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
ban # $nick(#,%k.num) 4 | raw -q kick # $nick(#,%k.num) Users has been banned from this channel, reason: %kick.msg $+ 
goto loop
}
:done
unset %k.*
unset %kick.msg
}


then in nicklist

(Massive)
.Mass Deop:/mdp
.-
.Mass Kick:/set %kick.msg $?="Enter a kick msg:" | mk
.Mass Ban:/mb
.Mass Kick Ban:/set %kick.msg $?="Enter a kick msg:" | mkb
-

just another way

Re: Mass Modes #83417 19/05/04 08:16 PM
Joined: Dec 2002
Posts: 208
C
Cobra Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
....
/me hides his eyes

smile

Cobra^

Re: Mass Modes #83418 21/05/04 08:11 PM
Joined: Apr 2004
Posts: 27
P
parvez Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Apr 2004
Posts: 27
Nicon thanks man! it worked
cool smile
grin