Event: OnChanMsg(from,channel,message,handle)
Syntax: OnChanMsg(object from,string channel,string message,object handle);
Event arguments
from- the sender
channel- the channel on which the message was sent
message- the message
handle- the output handler
This even trigger when a person send a message to a channel.
Note: You can get the host and the user of the sender by using from.Host
and from.User. To edit the output text use ole.SetOutput(text,handle);. To delete
the output text use ole.DelOutput(handle);
Example:
function OnChannelMsg(sender,channel,message,handle)
{
//If the sender mention your nickname in his message then highlight your nickname
outtext=text.replace(ole.Me,"08,01"+ole.Me+"");
//Check if the channel is #foo and if it is change the output format
if(channel.toLowerCase()=="#foo")
{
ole.SetOutput(sender+"⇒"+outtext);//this will display something like this: Joe⇒The output text
}
else{
ole.SetOutput("<"+sender+"> "+outtext);//this will display something like this: <Joe> The output text
}
}