Author Topic: AutoUnban  (Read 7400 times)

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
AutoUnban
« on: March 06, 2008, 02:51:27 PM »
This Is What I Have, I Want any Bans To Be Remove After X amount of time...Will This Work? (Set At 10 Seconds)

Dim LastBanned

Sub ONBAN(Nickname,Host,Channel,WhoBanned,Reason,ServerNumber)
If LastBanned <> Channel then
     If Nickname = NickName(ServerNumber) then
          'un-ban in 10 seconds
          SendCommand "/timer 1 2 10 /cs unban " & Channel,ServerNumber
          LastBanned = Channel
End if
End Sub

I Keep Getting Unexpected 'If' Errors.
~ Sam
~ Visit my website at http://www.TheCellist42.com

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: AutoUnban
« Reply #1 on: March 06, 2008, 05:33:50 PM »
Since you have 2 "If" statements, you need 2 "End if"  as well.
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: AutoUnban
« Reply #2 on: March 06, 2008, 05:46:27 PM »
Still Cant Get It To Work!
~ Sam
~ Visit my website at http://www.TheCellist42.com

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: AutoUnban
« Reply #3 on: March 06, 2008, 06:11:30 PM »
So you want all bans set by anyone in the channel, or bans set by yourself?
The IceChat God

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: AutoUnban
« Reply #4 on: March 06, 2008, 06:34:16 PM »
Not sure what you were trying exactly with LastBanned and the channel.
This will only allow you to unban once in the channel, and not again, until you restart the Script.

To check your nickname, it is MyNickName(ServerNumber)

/timer 1 2 10 /cs unban #channel.

I think the command must be wrong, it needs a nickname.
Also, you have set it to run 2 repetitions, thats not much use either.

So you do need to fix those, to make it work properly.
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: AutoUnban
« Reply #5 on: March 06, 2008, 09:38:33 PM »
Will This Work, I want bans to be removed in three hours...

Dim Banned

Sub ONBAN(Nickname,Host,Channel,WhoBanned,Reason,ServerNumber)
If Banned <> Channel then
     If Nickname = NickName(ServerNumber) then
          'unban in 10800 seconds
          SendCommand "/timer 1 1 10800 /cs unban" & Channel,Nickname
          Banned = Channel
      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: AutoUnban
« Reply #6 on: March 07, 2008, 08:27:34 AM »
No, it wont work, as you would already know.

Please read what I said, again, you missed on the MyNickName part, and the fact it will only unban once.
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: AutoUnban
« Reply #7 on: March 07, 2008, 01:13:42 PM »
Yes, I Understand, But You Never Explained How To Fix The Part Where It Only Unbans Once...

And, I Want It To Work On any Ban, should I still change it to MyNickName(ServerNumber)?
~ Sam
~ Visit my website at http://www.TheCellist42.com

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: AutoUnban
« Reply #8 on: March 07, 2008, 01:15:23 PM »
Well, first of all, what is the proper command to remove a ban with chanserv?

I am sure it is not just /cs unban channel, it must need a nick or such.
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: AutoUnban
« Reply #9 on: March 07, 2008, 01:19:41 PM »
using my channel: it would be... /cs unban #SamF "nick"
~ Sam
~ Visit my website at http://www.TheCellist42.com

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: AutoUnban
« Reply #10 on: March 07, 2008, 01:28:06 PM »
Give this a shot then.

You should notice some of the changes. Make it check the channel, and then use the channel name in the command.
Also had to change the timer ID, because otherwise it will keep trying to create number "1" and that can only exist once.
So $randtimer will create a random timer ID for you, so you dont need to worry about duplication.

Code: [Select]
Sub ONBAN(Nickname,Host,Channel,WhoBanned,Reason,ServerNumber)
if Channel = "#SamF" then
    'unban in 10800 seconds
    SendCommand "/timer $randtimer 1 10800 /cs unban #SamF " & Nickname, ServerNumber
end if
End Sub
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: AutoUnban
« Reply #11 on: March 07, 2008, 02:03:30 PM »
Thanks  :-D
~ Sam
~ Visit my website at http://www.TheCellist42.com

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: AutoUnban
« Reply #12 on: March 07, 2008, 02:12:22 PM »
I Still Can't Get It To Work
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: AutoUnban
« Reply #13 on: March 07, 2008, 02:16:55 PM »
That command will only unban the actualy nickname, not the entire ban mask, you would have to add some code to identify the actual mask that is banned. The ONMODE sub would be better for this purpose I think
"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

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: AutoUnban
« Reply #14 on: March 07, 2008, 02:35:20 PM »
I never use chanserv, so I don't know how that all works in any case.
The IceChat God