PS: reading the scripting documents helps a lot in such cases. Most problems you encountered here are explained very clearly in the scripting documentation.
So, major tip: each time you want to use a certain function, look up that function in the scripting documentation and read its explaination.
eg: Scripting Doc > Index > OnEvent_ChatWndSendMessage
quote:
Return Value
A string containing the message to be sent (thus not recieved) instead (thus it will be replaced) of Message. If you do not want to modify the message, simply return Message without changing it. No size restriction applies to the new message except for the maximum size allowed by Messenger. If the event handler returns an empty string, the message is ignored and not sent to the server.
Which covers your first problems you had.
eg: Scripting Doc > Index > OnEvent_ChatWndReceiveMessage(ChatWnd,
Origin, Message, MessageKind)
quote:
Origin
Name of the user that sent the message (which covers one of your other questions in how to get the contact's name), as it appears in the chat window.......
Return Value
A string containing the message to be displayed in the chat window instead of Message (which explains why you didn't saw what the contact had typed, but you saw your new string, at least a part of it). If you do not want to modify the message, simply return Message without changing it. The new string will be parsed for possible format codes. It is important to remember that the new message cannot be longer than the original one (use Message.length) and will be cut if necessary which explains why the string was truncated. Also, Messenger will not re-parse the message for emoticons codes.
Which covers all the other problems you had with ChatWndReceiveMessage.
Note: there are other VERY important notes about this event function. I'm not going to quote them all though, see the help files for that.
eg: Scripting Doc > Index > ChatWnd.SendMessage
quote:
The ChatWnd.SendMessage function sends a (new) message to the contacts currently present in the chat window.
Important:
quote:
The EditChangeAllowed property should be checked before this function is called.
eg: Scripting Doc > Index > ChatWnd.EditChangeAllowed
quote:
The ChatWnd.EditChangeAllowed property specifies whether or not text can be entered/send in the typing area of the chat window.
eg: Scripting Doc > Index > Messenger.MyName
quote:
A string containing the name of the current user (thus not a contact; the user is you... hence MyName).
etc...
The scripting documentation can be found on the official homepage of Messenger Plus!, here:
http://www.msgpluslive.net/scripts/view/13-Offici...ing-Documentation/
Or by selecting "Script Documentation" in the Options menu in the Script Editor.
have fun scripting...
but remember, read the docs first, then experiment with trial and error...