Author Topic: Mass Voice and DeVoice  (Read 2604 times)

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Mass Voice and DeVoice
« on: April 27, 2008, 02:45:21 PM »
This will voice all people in a channel, except for ops.

You can also de-voice everyone, except for ops.


Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
if Message = "!voiceall" then VoiceAll Channel,ServerNumber
if Message = "!devoiceall" then DeVoiceAll Channel,ServerNumber
End Sub

Sub VoiceAll(Channel,ServerNumber)
AllNicks = Split(Nicks(Channel,ServerNumber)," ")
for x = 0 to ubound(AllNicks)
if IsVoice(AllNicks(x),Channel,ServerNumber) = False and IsOP(AllNicks(x),Channel,ServerNumber) = False Then
     addvoice = addvoice & " " & AllNicks(x)       
     totalvoice=totalvoice+1
     if totalvoice = 5 then     
        SendCommand "/mode " & Channel & " +vvvvv" & addvoice,ServerNumber
        totalvoice=0
        addvoice=""
     end if
  end if
next
if totalvoice > 0 then
    SendCommand "/mode " & Channel & " +vvvvv" & addvoice,ServerNumber
end if

End Sub

Sub DeVoiceAll(Channel,ServerNumber)
AllNicks = Split(Nicks(Channel,ServerNumber)," ")
for x = 0 to ubound(AllNicks)
  if IsVoice(AllNicks(x),Channel,ServerNumber) = True and IsOP(AllNicks(x),Channel,ServerNumber) = False Then
     addvoice = addvoice & " " & AllNicks(x)       
     totalvoice=totalvoice+1
     if totalvoice = 5 then     
        SendCommand "/mode " & Channel & " -vvvvv" & addvoice,ServerNumber
        totalvoice=0
        addvoice=""
     end if
  end if
next
if totalvoice > 0 then
    SendCommand "/mode " & Channel & " -vvvvv" & addvoice,ServerNumber
end if

End Sub
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Mass Voice and DeVoice
« Reply #1 on: April 27, 2008, 02:47:22 PM »
thanks Snerf  :-D
~ Sam
~ Visit my website at http://www.TheCellist42.com

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Mass Voice and DeVoice
« Reply #2 on: April 28, 2008, 07:27:35 PM »
I Tried this So That Only I Or An Op Could Use It... For Responsibility Reasons... And...

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
if Message = "!voiceall" then VoiceAll Channel,ServerNumber
if Message = "!devoiceall" then DeVoiceAll Channel,ServerNumber
If not nickname = "TheCellist42" then Exit Sub
If Not ISOP(NickName,Channel,serverNumber) = True Then Exit Sub
End Sub


Sub VoiceAll(Channel,ServerNumber)
AllNicks = Split(Nicks(Channel,ServerNumber)," ")
for x = 0 to ubound(AllNicks)
if IsVoice(AllNicks(x),Channel,ServerNumber) = False and IsOP(AllNicks(x),Channel,ServerNumber) = False Then
     addvoice = addvoice & " " & AllNicks(x)       
     totalvoice=totalvoice+1
     if totalvoice = 5 then     
        SendCommand "/mode " & Channel & " +vvvvv" & addvoice,ServerNumber
        totalvoice=0
        addvoice=""
     end if
  end if
next
if totalvoice > 0 then
    SendCommand "/mode " & Channel & " +vvvvv" & addvoice,ServerNumber
end if

End Sub

Sub DeVoiceAll(Channel,ServerNumber)
AllNicks = Split(Nicks(Channel,ServerNumber)," ")
for x = 0 to ubound(AllNicks)
  if IsVoice(AllNicks(x),Channel,ServerNumber) = True and IsOP(AllNicks(x),Channel,ServerNumber) = False Then
     addvoice = addvoice & " " & AllNicks(x)       
     totalvoice=totalvoice+1
     if totalvoice = 5 then     
        SendCommand "/mode " & Channel & " -vvvvv" & addvoice,ServerNumber
        totalvoice=0
        addvoice=""
     end if
  end if
next
if totalvoice > 0 then
    SendCommand "/mode " & Channel & " -vvvvv" & addvoice,ServerNumber
end if

End Sub

It Works... But It Still Lets Anyone Use It... Any Ideas On How To Fix It?
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Mass Voice and DeVoice
« Reply #3 on: April 28, 2008, 09:19:18 PM »
You need to put the 'If ISOP...' statement before the 'If Message... statements
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein