Event: OnInput(winid,text)
Syntax: OnInput(string winid,string text)
Event arguments
winid- the id of the window where you typed text
text- the typed text
This event is trigerred when you type text into a chat window and press Enter. If you have typed into
the Status window then the winid param value will be "*".
Example:
//This example will show you how to create aliases for commands
function OnInput(winid,text)
{
command=winid.split(" ");
switch(command[0].toLowerCase())
{
case "/j": JoinChannel(command[1]); break; //Join channel
case "/n": ChangeNick(command[1]); break; //Change your nickname
case "/p": PartChannel(winid,command.slice(1)); break; //Part channel
}
}
function JoinChannel(channel)
{
fl=channel.substr(0,1);
if(fl!="#"&&fl!="+"&&fl!="&"&&fl!="."&&fl!="~"&&fl!="!"){ channel="#"+channel; }
ole.Join(channel);
}
function ChangeNick(newnick)
{
ole.Nick(newnick);
}
function PartChannel(channel,arrayMsg)
{
partMsg=arrayMsg.join(" ");
chanList=ole.GetChannels.split(",");
for(i=0;i<chanList.length;i++)
{
if(chanList[i]==channel){ ole.Part(channel,partMsg); }
}
}