Author Topic: Ban By Ops Only  (Read 13553 times)

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Ban By Ops Only
« on: March 06, 2008, 10:05:05 PM »
I Have This Script, It Is Supposed To Set Bans and Display The Ban Message. It Doesnt Really Work, What Is Wrong? I Tweaked It Many Times Before Posting Here, I Can't Figure It Out.


Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Left(Message,7) = "!ban " and Len(Message) > 7 then
  If ISOP(Nickname,Channel,ServerNumber)=True then
  ban = Mid(Message,8)
  SendCommand "/cs ban " & Channel & " " & Ban,ServerNumber
  End If
End If
End Sub

Also, Would Adding This Work:

Sub ONBAN(NickName,Host,ModeSetter,ModeSetterHost,Channel,ServerNumber)
  SendCommand "/say Banned! This Ban Will Automatically Be Removed In Three Hours."
End Sub

?????

Really Sorry For All Of The Questions  :-)
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Ban By Ops Only
« Reply #1 on: March 06, 2008, 11:10:32 PM »
'If Left(Message,7) = "!ban " and Len(Message) > 7 then'

that's the problem change the 7 to a 5

'  ban = Mid(Message,8)'

and change that 8 to a 6
« Last Edit: March 06, 2008, 11:16:12 PM by Morio »
"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

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Ban By Ops Only
« Reply #2 on: March 07, 2008, 06:02:00 AM »
Thanks, It Really Helped
~ Sam
~ Visit my website at http://www.TheCellist42.com

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Ban By Ops Only
« Reply #3 on: March 07, 2008, 01:33:00 PM »
You will want to change the ONBAN /say command, because if you happen to be in another channel, and a ban comes through your channel, it will say that there.
To send a message to a specific channel, and make it check for the ban on a specific channel, use:

Code: [Select]
If Channel = "#SamF" then
  SendCommand "/msg #SamF Your ban will be removed in 3 hours, ServerNumber
end if

You always need ",ServerNumber" at the end of a SendCommand function, in case you are connected to multiple servers.
This makes sure that the command gets sent to the server that the event (ONBAN, ONTEXT, whichever) originated on.
Otherwise it will be in the current server you are on (detected from the Active Window in IceChat).
If you never are, there is no need for it, but its just good practise to get into using that.
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Ban By Ops Only
« Reply #4 on: March 07, 2008, 02:09:23 PM »
I Contiually Get "Unterminated String Constant" What Does This Mean???
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Ban By Ops Only
« Reply #5 on: March 07, 2008, 02:17:54 PM »
what line is giving you the "Unterminated String Constant"?
"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

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Ban By Ops Only
« Reply #6 on: March 07, 2008, 02:23:41 PM »
Right Now, I Dont Need The Message, I am trying to get it so that if someone uses the ban command in my ops channel, it will ban the person in the regular channel, but when I do this, it says Nick1 currently isn't in use. What does this mean?


Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Left(Message,5) = "!ban " and Len(Message) > 5 then
If Channel = "#Sam-Ops" then
  If ISOP(Nickname,Channel,ServerNumber)=True then
  ban = Mid(Message,6)
  SendCommand "/cs ban #SamF" & " " & ServerNumber 
End If 
  End If
End If
End Sub
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Ban By Ops Only
« Reply #7 on: March 07, 2008, 02:35:14 PM »
SendCommand "/cs ban #SamF" & " " & ServerNumber

Replace it with

SendCommand "/cs ban "SamF " & ban,ServerNumber
"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

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Ban By Ops Only
« Reply #8 on: March 07, 2008, 02:38:13 PM »
[16:35]  ->> ERROR:modScriptFunctions:Ban.ice:Function:LoadScriptFile: Error Number:1025 : Expected end of statement

What Is This??
~ Sam
~ Visit my website at http://www.TheCellist42.com

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Ban By Ops Only
« Reply #9 on: March 07, 2008, 02:40:01 PM »
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Left(Message,5) = "!ban " and Len(Message) > 5 then
If Channel = "#Sam-Ops" then
  If ISOP(Nickname,Channel,ServerNumber)=True then
  ban = Mid(Message,6)
  SendCommand "/cs ban "SamF " & ban,ServerNumber
End If 
End If
End If
End Sub
~ Sam
~ Visit my website at http://www.TheCellist42.com

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Ban By Ops Only
« Reply #10 on: March 07, 2008, 02:41:04 PM »
Missing a quote somewhere, most likely.

Helps if you re-post the script.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Ban By Ops Only
« Reply #11 on: March 07, 2008, 02:45:09 PM »
sorry, this was my bad

  SendCommand "/cs ban SamF " & ban,ServerNumber

that is the command you need
"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

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Ban By Ops Only
« Reply #12 on: March 07, 2008, 02:48:20 PM »
I cant get it to ban anyone, I no longer get the error, but it doesnt ban the user...
~ Sam
~ Visit my website at http://www.TheCellist42.com

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Ban By Ops Only
« Reply #13 on: March 07, 2008, 02:50:41 PM »
Sorry, My Error, It Works!

Thank You, Thank You, Thank You
~ Sam
~ Visit my website at http://www.TheCellist42.com

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Ban By Ops Only
« Reply #14 on: March 08, 2008, 07:49:45 PM »
What Can I add To This Script So That It Will PM the User, saying the ban message

I have This

SendCommand "/msg <nick> You Have Been Banned Form #Channel, This Ban Will Be Removed In Three Hrs.

The Reason I have <nick> is because I dont know what to use so it will send the message to the person who was banned, any ideas?
~ Sam
~ Visit my website at http://www.TheCellist42.com