|
|
|
Vinniej
|
Vinniej
|
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
|
|
|
|
NeUtRoN_StaR
|
NeUtRoN_StaR
|
so u want something to deop or whatever the entire room minus you im assuming
|
|
|
|
NeUtRoN_StaR
|
NeUtRoN_StaR
|
[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.
|
|
|
|
Vinniej
|
Vinniej
|
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 :>
|
|
|
|
NeUtRoN_StaR
|
NeUtRoN_StaR
|
then you should be able to modify what i gave you to your own specifications
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
I played with an alias that uses $modespl give this a try
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 <= %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 <= %modenum) {
var %listnk = %listnk $gettok(%modelst,%x,44)
var %lenchk = $gettok(%listnk,0,32)
if (%lenchk >= %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.
|
|
|
|
Joined: Nov 2005
Posts: 104
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 104 |
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.
on *:TEXT:.deop *:#ChannelName:{
if ($$2 == $chr(42)) {
set %m 1
set %mt $nick($chan,0)
while (%m <= %mt) {
if ($nick($chan,%m) != $me) && ($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 <= %mt) {
if ($nick($chan,%m) != $me) && ($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 <= %mt) {
if ($nick($chan,%m) != $me) && ($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 <= %mt) {
if ($nick($chan,%m) != $me) && ($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.
|
|
|
|
Vinniej
|
Vinniej
|
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 ?
|
|
|
|
Joined: Nov 2005
Posts: 104
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 104 |
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.
|
|
|
|
NeUtRoN_StaR
|
NeUtRoN_StaR
|
..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
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
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
|
|
|
|
Joined: Nov 2005
Posts: 104
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 104 |
alright, so I've gave it an attempt. First time using $modespl, but it was so simple. Give this a try.
on *:TEXT:.voice*:#Channel:{
if ($$2 == $chr(42)) {
set %ma $modespl
set %m 1
set %mm 1
set %mt $nick($chan,0)
while (%m <= %mt) {
if ($nick($chan,%m) != $me) && ($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 <= %mt) {
if ($nick($chan,%m) != $me) && ($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 <= %mt) {
if ($nick($chan,%m) != $me) && ($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 <= %mt) {
if ($nick($chan,%m) != $me) && ($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.
|
|
|
|
Vinniej
|
Vinniej
|
Well, this one works. But only 1 time and I have to do ".deop *" again for more deops. Same for op, voice and devoice.
|
|
|
|
Joined: Nov 2005
Posts: 104
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 104 |
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.
on *:TEXT:.voice*:#Channel:{
if ($$2 == $chr(42)) {
set %ma $modespl
set %m 1
set %mm 1
set %mt $nick($chan,0)
while (%m <= %mt) {
if ($nick($chan,%m) != $me) && ($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 <= %mt) {
if ($nick($chan,%m) != $me) && ($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 <= %mt) {
if ($nick($chan,%m) != $me) && ($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 <= %mt) {
if ($nick($chan,%m) != $me) && ($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.
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
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
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 <= %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 <= %modenum) {
var %listnk = %listnk $gettok(%modelst,%x,44)
var %lenchk = $gettok(%listnk,0,32)
if (%lenchk >= %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 }
|
|
|
|
|
|
|
|