Author Topic: Script help  (Read 2376 times)

Zervic119

  • Guest
Script help
« on: August 10, 2008, 03:05:05 PM »
I'm a new person to scripting, so I'm not too good with it.

I was trying to make a script for when somebody says '!ban Cire', (Or whatever nickname I'm using at the time) the script replaces the text with '/mode #nsider2forums +b *!*@[my host]'

Firstly, I'd like to know if a script like this is possible, and if so, what it'd be.

Thanks.  :-D

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Re: Script help
« Reply #1 on: August 10, 2008, 03:32:43 PM »
You want a script that lets other people ban yourself? umm... Okay, I seethe logic in that. :)

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
if lcase(channel)="#nsider2forums" and lcase(message)="!ban " & lcase(GetIdentifier("$me",ServerNumber)) then SendCommand "/mode " & channel & " +b *!*@" & GetHost(channel,nickname,servernumber),ServerNumber
End Sub

Function GetHost(channel,nickname,ServerNumber)
  For i=1 to int(GetIdentifier("$nick(" & channel & ",0)",ServerNumber))
    if lcase(nickname)=lcase(GetIdentifier("$nick(" & channel & "," & i & ").nick",ServerNumber)) then GetHost = GetIdentifier("$nick(" & channel & "," & i & ").host",ServerNumber)
  Next
if len(GetHost) > 0 then GetHost = Mid(GetHost,instr(GetHost,"@")+1)
End Function

Save as a .ice File.
This message brought to you by the Wonderful Wizard of Oz.