Author Topic: Alias IF  (Read 3489 times)

SomeUser

  • Guest
Alias IF
« on: May 15, 2004, 08:09:56 AM »
Ok, this is probably simple, but I've looked through

and am still stuck.

I want an alias that will randomly select 1 of 3 responses

I want

/hi

{nick}

To do either:

/msg $channel Hi, $1
/msg $channel Hey, $1

or

/msg $channel Welcome,

$1

What would be the best way to do this :) ?

Thanks :)

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Alias IF
« Reply #1 on: May 15, 2004, 10:34:52 AM »
There is a script function called Aliases that checks for

additional aliases that can be used inside scripting. You make Aliases = TRUE when you have a match, so that IceChat no

longer looks for the command elsewhere.

Add this to an existing script file in the script editor, or create a new

one

----------start here--------------------------------
Function

ALIASES(Command,Parameters,ServerNumber)

Select Case Command
   Case "/hi"
     ALIASES=True 'we have a

match
     'here are the 3 random messages
     MyResponses = Array("Hi, " & Parameters, "Hey, " & Parameters,

"Welcome, " & Parameters)
     'pick a random response
     Randomize
     msg=int(UBound(MyResponses) *

Rnd)+1
     'send the message to the current channel
     SendCommand "//msg $channel " & MyResponses(msg)

,ServerNumber

End Select

End Function
----------end here--------------------------------

If you wish

to add a command to the nicklist popup, you can add this command to the menu editor:

Welcome
.Say Hello:/hi

$nick
The IceChat God