Author Topic: Wrong Ban Host?  (Read 2409 times)

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Wrong Ban Host?
« on: March 27, 2008, 08:34:53 PM »
I have a ban script, when you type !ban nick, it will ban that selected nick. Say I were to ban myself, !ban TheCellist42, It would set mode +b TheCellist42!@*!*  Any way I can make it so the script bans the host: ex. +b *!*@hostgoeshere.vhost?

Here Is The Script:

Code: [Select]
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 "/mode #SamF +b " & ban,ServerNumber
  SendCommand "/kick #SamF " & kick,ServerNumber
End If
End If
End If
End Sub


Anything I can add in the SendCommand "mode #SamF +b..." Line or anything I can replace that line with?

And Yes...I'm trying To Find Tutorials On This Type Of Scripting  :-D
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Wrong Ban Host?
« Reply #1 on: March 27, 2008, 11:40:03 PM »
This might not be the best way to do it, but it's the only way I can think of right now

Code: [Select]
Banning = "none"

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)
      If InStr(ban,"@") then 'banning a host
          SendCommand "/mode " & Channel & " +b " & ban
        End If
      Else 'banning a nick
        AllNicks = LCase(Nicks(Channel,ServerNumber))
        If InStr(AllNicks,ban) then 'if the nick in found on the channel right now
          SendCommand "/whois " & ban
          Banning = Channel
        Else
            SendCommand "/mode " & Channel & " +b " & ban & "!*@*",ServerNumber
        End If
      End If
    End If
  End If
End If
End Sub

Sub ONWHOISREPLY(Nickname,Trigger,Reply,ServerNumber)

If Banning <> None then
  If Trigger = "311" then
    ToBan = Mid(Reply,InStr(Reply,"@"))
    ToBan = Left(ToBan,InStr(Toban," ")-1)
    ToBan = LCase(Nickname & "*!*" & ToBan)
    SendCommand "/mode " & Banning & " +b " & ToBan,ServerNumber
    Banning = none
  End If
End If

End Sub


"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