Author Topic: AOP List Addition Script  (Read 4496 times)

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
AOP List Addition Script
« on: June 25, 2008, 06:30:18 PM »
This script adds a user to the chanserv aop list for a channel (mine) by typing !aop add <nick>, It also deletes tham by typing !aop del <nick>

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
net = getidentifier("$network",servernumber)
if lcase(net) = "aceirc" then
    if channel = "#cellist-ops" then
        if isop(channel,nickname,servernumber) = True then
            If left(message,9) = "!aop add " and len(message) > 9 then
                newop = mid(message,10)
                sendcommand "/cs access #cellist add " & newop & " 5",servernumberr
                sendcommand "/mode #cellist +o " & newop,servernumber
                sendcommand "/msg #cellist " & newop & " added as an op by " & nickname,servernumber
                sendcommand "/cs aop #cellist-ops add " & newop,servernumber
                sendcommand "/msg #cellist-ops " & newop & " added as an op by " & nickname,servernumber
                sendcommand "/mode #cellist-ops +I " & newop,servernumber
                sendcommand "/invite " & newop & " #cellist-ops",servernumber
            end if
            If left(message,9) = "!aop del " and len(message) > 9 then
                newop = mid(message,10)
                sendcommand "/cs access #cellist del " & newop,servernumberr
                sendcommand "/mode #cellist -o " & newop,servernumber
                sendcommand "/msg #cellist " & newop & " deleted from op by " & nickname,servernumber
                sendcommand "/cs aop #cellist-ops del" & newop,servernumber
                sendcommand "/msg #cellist-ops " & newop & " deleted from op by " & nickname,servernumber
                sendcommand "/mode #cellist-ops -I " & newop,servernumber
            end if
        end if
    end if
end if
End Sub

It doesn't work though, can someone help me with the errors in it, I can't make it work for some reason.
~ Sam
~ Visit my website at http://www.TheCellist42.com

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: AOP List Addition Script
« Reply #1 on: June 25, 2008, 07:42:31 PM »
in some places, you have ,servernumberr <-- spelled wrong.
Thats a start.
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: AOP List Addition Script
« Reply #2 on: June 25, 2008, 07:59:55 PM »
Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
net = getidentifier("$network",servernumber)
if lcase(net) = "aceirc" then
    if channel = "#cellist-ops" then
        if isop(channel,nickname,servernumber) = True then
            If left(message,9) = "!aop add " and len(message) > 9 then
                newop = mid(message,10)
                sendcommand "/cs access #cellist add " & newop & " 5",servernumber
                sendcommand "/mode #cellist +o " & newop,servernumber
                sendcommand "/msg #cellist " & newop & " added as an op by " & nickname,servernumber
                sendcommand "/cs aop #cellist-ops add " & newop,servernumber
                sendcommand "/msg #cellist-ops " & newop & " added as an op by " & nickname,servernumber
                sendcommand "/mode #cellist-ops +I " & newop,servernumber
                sendcommand "/invite " & newop & " #cellist-ops",servernumber
            end if
            If left(message,9) = "!aop del " and len(message) > 9 then
                newop = mid(message,10)
                sendcommand "/cs access #cellist del " & newop,servernumber
                sendcommand "/mode #cellist -o " & newop,servernumber
                sendcommand "/msg #cellist " & newop & " deleted from op by " & nickname,servernumber
                sendcommand "/cs aop #cellist-ops del" & newop,servernumber
                sendcommand "/msg #cellist-ops " & newop & " deleted from op by " & nickname,servernumber
                sendcommand "/mode #cellist-ops -I " & newop,servernumber
            end if
        end if
    end if
end if
End Sub




Nothing...
~ Sam
~ Visit my website at http://www.TheCellist42.com

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Re: AOP List Addition Script
« Reply #3 on: June 25, 2008, 08:42:28 PM »
Do you get any error messages?
Those would be helpful.

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: AOP List Addition Script
« Reply #4 on: June 25, 2008, 11:58:18 PM »
none at all, It just does nothing  :?
~ Sam
~ Visit my website at http://www.TheCellist42.com

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: AOP List Addition Script
« Reply #5 on: June 26, 2008, 09:26:00 AM »
Is your channel exactly "#cellist-ops" or maybe you want to do a if lcase(Channel) = "#cellist-ops".
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: AOP List Addition Script
« Reply #6 on: June 26, 2008, 10:06:22 AM »
on line 5:
Code: [Select]
if isop(channel,nickname,servernumber) = True thenShould be:
Code: [Select]
If ISOP(Nickname,Channel,ServerNumber) = True then
"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