Author Topic: Script question -- temp ban script...  (Read 4018 times)

Chrono

  • Guest
Script question -- temp ban script...
« on: January 20, 2009, 09:35:46 AM »
I have a question about this script I've written, doesn't seem to do anything...  let me start with what works:

This worky:

Alias: /tb /! TemporaryBan
Code: [Select]
Sub TemporaryBan()
    Dim UserToBan, Reason
    UserToBan = "DontBanMe"
    Reason = "This is a reason"
    Dim FullMask, BanMask

    FullMask = GetIdentifier("$nick(#fantasyrpg," & UserToBan & ").mask")
    BanMask = GetIdentifier("$mask(" & FullMask & ",2)")
    Channel = GetIdentifier("$channel" )
    ServerNumber = GetIdentifier("$currentservernumber")

    SendCommand "/mode " & Channel & " +b " & BanMask,ServerNumber
    SendCommand "/kick " & UserToBan & " " & Reason & " (30 second ban)"
    SendCommand "/timer $rndtimer 1 30 /mode " & Channel & " -b " & BanMask,ServerNumber
End Sub




This doesn't work, but I think it should:

Alias: /tb /! TemporaryBan $1 $2-
Code: [Select]
Sub TemporaryBan(UserToBan, Reason  )
    Dim FullMask, BanMask

    FullMask = GetIdentifier("$nick(#fantasyrpg," & UserToBan & ").mask")
    BanMask = GetIdentifier("$mask(" & FullMask & ",2)")
    Channel = GetIdentifier("$channel" )
    ServerNumber = GetIdentifier("$currentservernumber")

    SendCommand "/mode " & Channel & " +b " & BanMask,ServerNumber
    SendCommand "/kick " & UserToBan & " " & Reason & " (30 second ban)"
    SendCommand "/timer $rndtimer 1 30 /mode " & Channel & " -b " & BanMask,ServerNumber
End Sub

What am I doing wrong?  No errors show up with I do /tb Nick some words here, and nothing shows up when I save the aliases or the scripts...  Nothing happens. :<

Chrono

  • Guest
Re: Script question -- temp ban script...
« Reply #1 on: January 20, 2009, 09:40:25 AM »
Oh, I was missing a pipe between my arguments to Temporary ban... my alias should have been

/tb /! TemporaryBan $1 | $2-

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Script question -- temp ban script...
« Reply #2 on: January 20, 2009, 11:17:41 AM »
Yes, the pipe is needed there, this way the variables that are retreived with the script, can have words/spaces in them.
The IceChat God