I think that a switch statement would not be the best for someone who is just learning JScript as he will probably want multiple commands of variable length, which will make a switch statement difficult to manage.
Try this:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind) {
// In the following line, note that 10 is the length of the string '!processor'
if (Message.substring(0, 10).toLowerCase() == '!processor') {
// Put code here to send information about your processor.
}
// again, 9 refers to the length of '!graphics'
if (Message.substring(0, 9).toLowerCase() == '!graphics') {
// Put code here to send information about your graphics card.
}
return Message;
}
Note that if you add a return statement anywhere else in there, you should return Message so you know what your partner said.