Author Topic: Mass voice/devoice, halfop/dehalfop, and op/deop  (Read 4188 times)

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Mass voice/devoice, halfop/dehalfop, and op/deop
« on: June 15, 2008, 05:43:48 PM »
This script is about half done, I will add an update to it in a little while.

Pretty much, this just mass voices, half-ops and ops, as well as mass devoices dehalf-ops, and de-ops everyone that isn't already that mode.

Code: [Select]
Dim Mass

Sub Massmodes()
Mass = createdialog("Mass Modes",298,150,209,73)
addbutton Mass,"Voice",1,1,100,20,2,a,"voice"
addbutton Mass,"Halfop",1,21,100,20,2,b,"halfop"
addbutton Mass,"Op",1,41,100,20,2,c,"op"
addbutton Mass,"Close",1,61,201,20,2,f,"exit"
addbutton Mass,"De-Voice",102,1,100,20,2,g,"devoice"
addbutton Mass,"De-Halfop",102,21,100,20,2,h,"dehalfop"
addbutton Mass,"De-Op",102,41,100,20,2,i,"deop"
showdialog Mass
End Sub

Dim notvoiced
Dim v

Sub voice_Clicked()
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if not isvoice(nick,channel,servernumber) then
     if nick = mynick then
      notvoiced = notvoiced
     else
      notvoiced = notvoiced + " " + nick
      v = v + "v"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & v & " " & notvoiced,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim voiced

Sub devoice_Clicked()
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if isvoice(nick,channel,servernumber) then
     if nick = mynick then
      voiced = voiced
     else
      voiced = voiced + " " + nick
      v = v + "v"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & v & " " & voiced,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim nothopped
Dim h

Sub halfop_Clicked()
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if not ishalfop(nick,channel,servernumber) then
     if nick = mynick then
      nothopped = nothopped
     else
      nothopped = nothopped + " " + nick
      h = h + "h"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & h & " " & nothopped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim hopped

Sub dehalfop_Clicked()
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if ishalfop(nick,channel,servernumber) then
     if nick = mynick then
      hopped = hopped
     else
      hopped = hopped + " " + nick
      h = h + "h"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & h & " " & hopped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim notopped
Dim o

Sub op_Clicked()
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if not isop(nick,channel,servernumber) then
     if nick = mynick then
      notopped = notopped
     else
      notopped = notopped + " " + nick
      o = o + "o"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & o & " " & notopped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim opped

Sub deop_Clicked()
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if isop(nick,channel,servernumber) then
     if nick = mynick then
      opped = opped
     else
      opped = opped + " " + nick
      o = o + "o"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & o & " " & opped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Sub exit_Clicked()
closedialog Mass
End Sub

Just paste it all into the script editor and save as (*.ICE).

To make things easier, you might want an alias to open the dialog window.

Code: [Select]
/mass /! MassModes
After the window is opened, just click the button you want,(it mass modes the current window/channel)

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Re: Mass voice/devoice, halfop/dehalfop, and op/deop
« Reply #1 on: June 17, 2008, 01:17:39 AM »
Ok, I finally finished working on the mass modes script. :mrgreen:

Code: [Select]
Dim Mass

Sub Massmodes()
Mass = createdialog("Mass Modes",298,150,209,113)
addbutton Mass,"Voice",1,1,100,20,2,a,"voice"
addbutton Mass,"Halfop",1,21,100,20,2,b,"halfop"
addbutton Mass,"Op",1,41,100,20,2,c,"op"
addbutton Mass,"Admin",1,61,100,20,2,d,"admin"
addbutton Mass,"Owner",1,81,100,20,2,e,"owner"
addbutton Mass,"Close",1,101,201,20,2,f,"exit"
addbutton Mass,"De-Voice",102,1,100,20,2,g,"devoice"
addbutton Mass,"De-Halfop",102,21,100,20,2,h,"dehalfop"
addbutton Mass,"De-Op",102,41,100,20,2,i,"deop"
addbutton Mass,"De-Admin",102,61,100,20,2,j,"deadmin"
addbutton Mass,"De-Owner",102,81,100,20,2,k,"deowner"
showdialog Mass
End Sub

Dim notvoiced
Dim v

Sub voice_Clicked()
notvoiced = ""
v = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if not isvoice(nick,channel,servernumber) then
     if nick = mynick then
      notvoiced = notvoiced
     else
      notvoiced = notvoiced + " " + nick
      v = v + "v"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & v & " " & notvoiced,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim voiced

Sub devoice_Clicked()
voiced = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if isvoice(nick,channel,servernumber) then
     if nick = mynick then
      voiced = voiced
     else
      voiced = voiced + " " + nick
      v = v + "v"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & v & " " & voiced,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim nothopped
Dim h

Sub halfop_Clicked()
nothopped = ""
h = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if not ishalfop(nick,channel,servernumber) then
     if nick = mynick then
      nothopped = nothopped
     else
      nothopped = nothopped + " " + nick
      h = h + "h"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & h & " " & nothopped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim hopped

Sub dehalfop_Clicked()
hopped = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if ishalfop(nick,channel,servernumber) then
     if nick = mynick then
      hopped = hopped
     else
      hopped = hopped + " " + nick
      h = h + "h"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & h & " " & hopped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim notopped
Dim o

Sub op_Clicked()
notopped = ""
o = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if not isop(nick,channel,servernumber) then
     if nick = mynick then
      notopped = notopped
     else
      notopped = notopped + " " + nick
      o = o + "o"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & o & " " & notopped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim opped

Sub deop_Clicked()
opped = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if isop(nick,channel,servernumber) then
     if nick = mynick then
      opped = opped
     else
      opped = opped + " " + nick
      o = o + "o"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & o & " " & opped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim notadmined
Dim a

Sub admin_Clicked()
notadmined = ""
a = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if getidentifier("$nick(" & channel & "," & nick & ").admin",servernumber) = "$false" then
     if nick = mynick then
      notadmined = notadmined
     else
      notadmined = notadmined + " " + nick
      a = a + "a"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & a & " " & notadmined,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim Admined

Sub deadmin_Clicked()
admined = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if getidentifier("$nick(" & channel & "," & nick & ").admin",servernumber) = "$true" then
     if nick = mynick then
      admined = admined
     else
      admined = admined + " " + nick
      a = a + "a"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & a & " " & admined,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim notownered
Dim q

Sub owner_Clicked()
notownered = ""
q = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if getidentifier("$nick(" & channel & "," & nick & ").owner",servernumber) = "$false" then
     if nick = mynick then
      notownered = notownered
     else
      notownered = notownered + " " + nick
      q = q + "q"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & q & " " & notownered,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim ownered

Sub deowner_Clicked()
ownered = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if getidentifier("$nick(" & channel & "," & nick & ").owner",servernumber) = "$true" then
     if nick = mynick then
      ownered = ownered
     else
      ownered = ownered + " " + nick
      q = q + "q"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & q & " " & ownered,servernumber
 else
  sendcommand "/echo " & channel & " is now a channel.",servernumber
 end if
End Sub

Sub exit_Clicked()
closedialog Mass
End Sub

Some bugs with it; Some of the buttons sometimes glitch up, and don't appear. When this happens, just reload the script, and it should be fine.

Once again, the alias.
Code: [Select]
/mass /! massmodes

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Re: Mass voice/devoice, halfop/dehalfop, and op/deop
« Reply #2 on: June 19, 2008, 04:40:57 PM »
Dark`Star helped me fix the bugs :P

Code: [Select]
Dim Mass

Sub Massmodes()
Mass = createdialog("Mass Modes",410,150,209,113)
addbutton Mass,"Voice",1,1,100,20,1,0,"voice"
addbutton Mass,"Halfop",1,21,100,20,2,0,"halfop"
addbutton Mass,"Op",1,41,100,20,3,0,"op"
addbutton Mass,"Admin",1,61,100,20,4,0,"admin"
addbutton Mass,"Owner",1,81,100,20,5,0,"owner"
addbutton Mass,"Close",1,101,201,20,6,0,"exit"
addbutton Mass,"De-Voice",102,1,100,20,7,0,"devoice"
addbutton Mass,"De-Halfop",102,21,100,20,8,0,"dehalfop"
addbutton Mass,"De-Op",102,41,100,20,9,0,"deop"
addbutton Mass,"De-Admin",102,61,100,20,10,0,"deadmin"
addbutton Mass,"De-Owner",102,81,100,20,11,0,"deowner"
showdialog Mass
End Sub

Dim notvoiced
Dim v

Sub voice_Clicked()
notvoiced = ""
v = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if not isvoice(nick,channel,servernumber) then
     if nick = mynick then
      notvoiced = notvoiced
     else
      notvoiced = notvoiced + " " + nick
      v = v + "v"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & v & " " & notvoiced,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim voiced

Sub devoice_Clicked()
voiced = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if isvoice(nick,channel,servernumber) then
     if nick = mynick then
      voiced = voiced
     else
      voiced = voiced + " " + nick
      v = v + "v"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & v & " " & voiced,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim nothopped
Dim h

Sub halfop_Clicked()
nothopped = ""
h = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if not ishalfop(nick,channel,servernumber) then
     if nick = mynick then
      nothopped = nothopped
     else
      nothopped = nothopped + " " + nick
      h = h + "h"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & h & " " & nothopped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim hopped

Sub dehalfop_Clicked()
hopped = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if ishalfop(nick,channel,servernumber) then
     if nick = mynick then
      hopped = hopped
     else
      hopped = hopped + " " + nick
      h = h + "h"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & h & " " & hopped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim notopped
Dim o

Sub op_Clicked()
notopped = ""
o = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if not isop(nick,channel,servernumber) then
     if nick = mynick then
      notopped = notopped
     else
      notopped = notopped + " " + nick
      o = o + "o"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & o & " " & notopped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim opped

Sub deop_Clicked()
opped = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if isop(nick,channel,servernumber) then
     if nick = mynick then
      opped = opped
     else
      opped = opped + " " + nick
      o = o + "o"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & o & " " & opped,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim notadmined
Dim a

Sub admin_Clicked()
notadmined = ""
a = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if getidentifier("$nick(" & channel & "," & nick & ").admin",servernumber) = "$false" then
     if nick = mynick then
      notadmined = notadmined
     else
      notadmined = notadmined + " " + nick
      a = a + "a"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & a & " " & notadmined,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim Admined

Sub deadmin_Clicked()
admined = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if getidentifier("$nick(" & channel & "," & nick & ").admin",servernumber) = "$true" then
     if nick = mynick then
      admined = admined
     else
      admined = admined + " " + nick
      a = a + "a"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & a & " " & admined,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim notownered
Dim q

Sub owner_Clicked()
notownered = ""
q = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if getidentifier("$nick(" & channel & "," & nick & ").owner",servernumber) = "$false" then
     if nick = mynick then
      notownered = notownered
     else
      notownered = notownered + " " + nick
      q = q + "q"
     end if
    end if
  next
   sendcommand "/mode " & channel & " +" & q & " " & notownered,servernumber
 else
  sendcommand "/echo " & channel & " is not a channel.",servernumber
 end if
End Sub

Dim ownered

Sub deowner_Clicked()
ownered = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$currentservernumber")
windowtype = getidentifier("$currentwindowtype")
total = getidentifier("$nick(" & channel & ",0)",servernumber)
mynick = getidentifier("$me",servernumber)
 if windowtype = "2" then
  for i = 1 to total
   nick = getidentifier("$nick(" & channel & "," & i & ")",servernumber)
    if getidentifier("$nick(" & channel & "," & nick & ").owner",servernumber) = "$true" then
     if nick = mynick then
      ownered = ownered
     else
      ownered = ownered + " " + nick
      q = q + "q"
     end if
    end if
  next
   sendcommand "/mode " & channel & " -" & q & " " & ownered,servernumber
 else
  sendcommand "/echo " & channel & " is now a channel.",servernumber
 end if
End Sub

Sub exit_Clicked()
closedialog Mass
End Sub

Alias:
Code: [Select]
/mass /! MassModes

Lauranator

  • Newbie
  • *
  • Posts: 14
Re: Mass voice/devoice, halfop/dehalfop, and op/deop
« Reply #3 on: June 22, 2008, 09:23:29 AM »
Cool...thx HackB.   I was wondering if such a things as this was possible.

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Re: Mass voice/devoice, halfop/dehalfop, and op/deop
« Reply #4 on: June 23, 2008, 01:09:30 PM »
You would be surprised whats possible with a lil bit of code.  :mrgreen: