mIRC Home    About    Download    Register    News    Help

Print Thread
Mass op, deop, voice, devoice. #141178 06/02/06 10:26 AM
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
Hi,

First of all, I've searched through google, forumsearch etc..

I'm looking for a snippet what does mass op, deop, voice and devoice when im doing ".op *, .deop *, .voice *, .devoice *". Its just for my bot. I only can find some Aliasses, but they wont work for my bot.

Thanks in advance

Re: Mass op, deop, voice, devoice. #141179 06/02/06 09:17 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
so u want something to deop or whatever the entire room minus you im assuming

Re: Mass op, deop, voice, devoice. #141180 06/02/06 09:32 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
[code]
on @N:text:.mdeop:#:{
var %n = 0
var %tn = $nick($chan, 0)
while (%n <= %tn) {
inc %n
if ($nick($chan,%n) != $me) {
mode $chan -o $nick($chan,%n)
}
}
}
[code]

i didnt know how to go about having a wildcard in the text matching section and having it no be interpretted as a wildcard

Last edited by NeUtRoN_StaR; 06/02/06 09:35 PM.
Re: Mass op, deop, voice, devoice. #141181 06/02/06 10:17 PM
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
I just want a mass op script, rest I can make it self, based on the mass op script.

I still can't find anything on Google.

* is a wildcard :>

Re: Mass op, deop, voice, devoice. #141182 06/02/06 10:42 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
then you should be able to modify what i gave you to your own specifications

Re: Mass op, deop, voice, devoice. #141183 06/02/06 11:05 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I played with an alias that uses $modespl

give this a try
Code:
on @*:text:!mass *:#channel:{
  if ($nick isop $chan) { multimode $$2 $chan }
  if ($nick !isop $chan) { kick # $nick Don't do that }
}
alias Multimode {
  var %channel = $2
  if ($1 == deop) { 
    var %prefix = -
    var %mode = o
  }
  if ($1 == op) { 
    var %prefix = +
    var %mode = o
  }
  var %all.nicks = $nick(%channel,0), %i = 1
  while (%i &lt;= %all.nicks) {
    var %nic = $nick(%channel,%i)
    sline %channel %nic 
    inc %i
  }
  sline -r %channel $me
  sline -r %channel $nick
  var %modecnt = $modespl
  var %modelst = $snick(%channel)
  var %modenum = $gettok(%modelst,0,44)
  var %i = 1
  var %x = 1
  while (%i &lt;= %modenum) {
    var %listnk = %listnk $gettok(%modelst,%x,44)
    var %lenchk = $gettok(%listnk,0,32)
    if (%lenchk &gt;= %modecnt) {
      mode %channel %prefix $+ $str(%mode,$modespl) %listnk
      var %listnk = ""
    }
    if (%i == %modenum) {
      mode %channel %prefix $+ $str(%mode,$modespl) %listnk
      var %listnk = ""
    }
    inc %i
    inc %x
  }
}


EDIT I left out $chan in the isop checks

Last edited by MikeChat; 06/02/06 11:15 PM.
Re: Mass op, deop, voice, devoice. #141184 07/02/06 02:51 AM
Joined: Nov 2005
Posts: 105
D
drc4 Offline
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 105
I see that you have a couple reply's, but I went ahead and took my own stab at it as well. You can specify * to mass op/deop/voice/devoice or supply a specific user to op/deop/voice/devoice.
Code:
on *:TEXT:.deop *:#ChannelName:{
  if ($$2 == $chr(42)) {
    set %m 1
    set %mt $nick($chan,0)
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) isop $chan) .mode $chan -o $nick($chan,%m)
      inc %m 1
    }
    unset %m
    unset %mt
  }
  else { mode $chan -o $$2 }
}
on *:TEXT:.op *:#ChannelName:{
  if ($$2 == $chr(42)) {
    set %m 1
    set %mt $nick($chan,0)
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) !isop $chan) .mode $chan +o $nick($chan,%m)
      inc %m 1
    }
    unset %m
    unset %mt
  }
  else { mode $chan +o $$2 }
}
on *:TEXT:.devoice *:#ChannelName:{
  if ($$2 == $chr(42)) {
    set %m 1
    set %mt $nick($chan,0)
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) isvoice $chan) .mode $chan -v $nick($chan,%m)
      inc %m 1
    }
    unset %m
    unset %mt
  }
  else { mode $chan -v $$2 }
}
on *:TEXT:.voice *:#ChannelName:{
  if ($$2 == $chr(42)) {
    set %m 1
    set %mt $nick($chan,0)
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) !isvoice $chan) .mode $chan +v $nick($chan,%m)
      inc %m 1
    }
    unset %m
    unset %mt
  }
  else { mode $chan +v $$2 }
}

The usage. ( .deop/.op/.voice/devoice <* or specific user> )
Just change the #ChannelName to the name of your Channel, and you're set. But you may want to add a user level, or a check to see if you're the one submiting the request, so that not everyone can abuse the bot.

Re: Mass op, deop, voice, devoice. #141185 07/02/06 11:28 AM
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
The script from drc4 is working. How to (de)op and (de)voice at the same time (max 6).

//mode #chan +ooooo $nick $nick $nick $nick $nick $nick ?

Re: Mass op, deop, voice, devoice. #141186 07/02/06 03:46 PM
Joined: Nov 2005
Posts: 105
D
drc4 Offline
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 105
I'm short on time, but that wouldn't be hard to do. I'm currently in a combat readiness class, and on lunch. If no one attempts to knock this out before me, I'll do so as soon as the DOT is over. No idea when that will be.

Re: Mass op, deop, voice, devoice. #141187 07/02/06 10:30 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
..deopdevoice: { mode # -ooooo $$1 $2 $3 $4 $5
mode # -vvvvv $1 $2 $3 $4 $5
}
i think 5 might be the most u can do at a time
im not sure
if that does turn out to be the case just add another line to each set with $6

Re: Mass op, deop, voice, devoice. #141188 07/02/06 10:39 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
How many you can do at a time depends on $modespl. This number can and will vary accross different networks/servers, so it's not a good idea to hard code stuff. Use $modespl


Gone.
Re: Mass op, deop, voice, devoice. #141189 07/02/06 10:51 PM
Joined: Nov 2005
Posts: 105
D
drc4 Offline
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 105
alright, so I've gave it an attempt. First time using $modespl, but it was so simple. Give this a try.
Code:
on *:TEXT:.voice*:#Channel:{
  if ($$2 == $chr(42)) {
    set %ma $modespl
    set %m 1
    set %mm 1
    set %mt $nick($chan,0)  
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) !isvoice $chan) { .set %mn %mn $nick($chan,%m) }
      inc %m 1  
      if (%mm == %ma) { mode $chan + $+ $str(v,$modespl) %mn | unset %mm | unset %mn }
      inc %mm 1
    }  
    echo -a mode $chan + $+ $str(v,$modespl) %mn
    unset %m  
    unset %mt
    unset %mm
  } 
  else { mode $chan +v $$2 }
}
on *:TEXT:.devoice*:#Channel:{
  if ($$2 == $chr(42)) {
    set %ma $modespl
    set %m 1
    set %mm 1
    set %mt $nick($chan,0)  
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) isvoice $chan) { .set %mn %mn $nick($chan,%m) }
      inc %m 1  
      if (%mm == %ma) { mode $chan - $+ $str(v,$modespl) %mn | unset %mm | unset %mn }
      inc %mm 1
    }  
    echo -a mode $chan - $+ $str(v,$modespl) %mn
    unset %m  
    unset %mt  
    unset %mm
  } 
  else { mode $chan -v $$2 }
}
on *:TEXT:.op*:#Channel:{
  if ($$2 == $chr(42)) {
    set %ma $modespl
    set %m 1
    set %mm 1
    set %mt $nick($chan,0)  
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) !isop $chan) { .set %mn %mn $nick($chan,%m) }
      inc %m 1  
      if (%mm == %ma) { mode $chan + $+ $str(o,$modespl) %mn | unset %mm | unset %mn }
      inc %mm 1
    }  
    echo -a mode $chan + $+ $str(o,$modespl) %mn
    unset %m  
    unset %mt 
    unset %mm 
  } 
  else { mode $chan +o $$2 }
}
on *:TEXT:.deop*:#Channel:{
  if ($$2 == $chr(42)) {
    set %ma $modespl
    set %m 1
    set %mm 1
    set %mt $nick($chan,0)  
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) isop $chan) { .set %mn %mn $nick($chan,%m) }
      inc %m 1  
      if (%mm == %ma) { mode $chan - $+ $str(o,$modespl) %mn | unset %mm | unset %mn }
      inc %mm 1
    }  
    echo -a mode $chan - $+ $str(o,$modespl) %mn
    unset %m  
    unset %mt
    unset %mm
  } 
  else { mode $chan -o $$2 }
}

Just edit the #Channel, and the rest should work as the other script did. If you have any problems, let me know.

Last edited by drc4; 07/02/06 10:55 PM.
Re: Mass op, deop, voice, devoice. #141190 08/02/06 07:52 AM
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
Well, this one works. But only 1 time and I have to do ".deop *" again for more deops. Same for op, voice and devoice.

Re: Mass op, deop, voice, devoice. #141191 08/02/06 08:46 AM
Joined: Nov 2005
Posts: 105
D
drc4 Offline
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 105
Stupid Stupid me lol. I had an echo statement where I tested the script in a large channel. I wasn't the channel owner, therefore I couldn't test the script myself, actually oping/voicing everyone, so I had it echo the command line to me. And I didn't take out one of the instances before I posted it here. My apologie's. The code however should now work, issueing it only once.
Code:
on *:TEXT:.voice*:#Channel:{
  if ($$2 == $chr(42)) {
    set %ma $modespl
    set %m 1
    set %mm 1
    set %mt $nick($chan,0)  
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) !isvoice $chan) { .set %mn %mn $nick($chan,%m) }
      inc %m 1  
      if (%mm == %ma) { mode $chan + $+ $str(v,$modespl) %mn | unset %mm | unset %mn }
      inc %mm 1
    }  
    mode $chan + $+ $str(v,$modespl) %mn
    unset %m  
    unset %mt
    unset %mn
  } 
  else { mode $chan +v $$2 }
}
on *:TEXT:.devoice*:#Channel:{
  if ($$2 == $chr(42)) {
    set %ma $modespl
    set %m 1
    set %mm 1
    set %mt $nick($chan,0)  
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) isvoice $chan) { .set %mn %mn $nick($chan,%m) }
      inc %m 1  
      if (%mm == %ma) { mode $chan - $+ $str(v,$modespl) %mn | unset %mm | unset %mn }
      inc %mm 1
    }  
    mode $chan - $+ $str(v,$modespl) %mn
    unset %m  
    unset %mt
    unset %mn
  } 
  else { mode $chan -v $$2 }
}
on *:TEXT:.op*:#Channel:{
  if ($$2 == $chr(42)) {
    set %ma $modespl
    set %m 1
    set %mm 1
    set %mt $nick($chan,0)  
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) !isop $chan) { .set %mn %mn $nick($chan,%m) }
      inc %m 1  
      if (%mm == %ma) { mode $chan + $+ $str(o,$modespl) %mn | unset %mm | unset %mn }
      inc %mm 1
    }  
    mode $chan + $+ $str(o,$modespl) %mn
    unset %m  
    unset %mt
    unset %mn  
  } 
  else { mode $chan +o $$2 }
}
on *:TEXT:.deop*:#Channel:{
  if ($$2 == $chr(42)) {
    set %ma $modespl
    set %m 1
    set %mm 1
    set %mt $nick($chan,0)  
    while (%m &lt;= %mt) {
      if ($nick($chan,%m) != $me) &amp;&amp; ($nick($chan,%m) isop $chan) { .set %mn %mn $nick($chan,%m) }
      inc %m 1  
      if (%mm == %ma) { mode $chan - $+ $str(o,$modespl) %mn | unset %mm | unset %mn }
      inc %mm 1
    }  
    mode $chan - $+ $str(o,$modespl) %mn
    unset %m  
    unset %mt
    unset %mn 
  } 
  else { mode $chan -o $$2 }
}

Again, my apologies.

Re: Mass op, deop, voice, devoice. #141192 08/02/06 04:55 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:
I just want a mass op script, rest I can make it self, based on the mass op script.


I have edited my code now to include the half op and voice
usage is simply !mass and theword:
op, deop, hop, dehop, voice or devoice

like !mass op or !mass devoice

the
Code:
on @*:text:!mass *:#channel:{

  if ($nick isop $chan) { multimode $$2 $chan $nick }

  if ($nick !isop $chan) { msg $chan $nick You do not have authorization. }

}

alias Multimode {
  var %channel = $2
  var %nick = $3

  if ($1 == deop) { 
    var %prefix = -
    var %mode = o
  }
  if ($1 == op) { 
    var %prefix = +
    var %mode = o
  }
  if ($1 == dehop) { 
    var %prefix = -
    var %mode = h
  }
  if ($1 == hop) { 
    var %prefix = +
    var %mode = h
  }
  if ($1 == devoice) { 
    var %prefix = -
    var %mode = v
  }
  if ($1 == voice) { 
    var %prefix = +
    var %mode = v
  }

  var %all.nicks = $nick(%channel,0), %i = 1
  while (%i &lt;= %all.nicks) {
    var %nic = $nick(%channel,%i)
    sline %channel %nic 
    inc %i
  }
  sline -r %channel $me
  sline -r %channel %nick
  var %modecnt = $modespl
  var %modelst = $snick(%channel)
  var %modenum = $gettok(%modelst,0,44)
  var %i = 1
  var %x = 1
  while (%i &lt;= %modenum) {
    var %listnk = %listnk $gettok(%modelst,%x,44)
    var %lenchk = $gettok(%listnk,0,32)
    if (%lenchk &gt;= %modecnt) {
      mode %channel %prefix $+ $str(%mode,$modespl) %listnk
      var %listnk = ""
    }
    if (%i == %modenum) {
      mode %channel %prefix $+ $str(%mode,$modespl) %listnk
      var %listnk = ""
    }
    inc %i
    inc %x
  }
}


Some comments on this part of the script
on @*:text:!mass *:#channel:{

you should have an access level on the bot to restrict this to either yourself or you and whatever others
If that level were "1000" the line would be
on @1000:text:!mass *:#channel:{

and then the isop check would not be needed, simply send the info to the alias.
on @1000:text:!mass *:#channel:{
multimode $$2 $chan $nick
}