Hen, it is not possible to do _exactly_ what you want.
You can only change the text which is recieved in your own chat window, thus not on the contact's side. And it can't be longer than the original recieved text (not a problem your case). But also, you can not completely discard it as in not showing anything;
there will always be a line shown, albite it may be an empty line.
Also remember, if you modify the sent text, then the modified text is send, not the thing you originally typed (scripts parse the sent text before it is actually send to your contacts). To put it very simply: If you type "Hello World" and a script changes that text to "BlahBlah" then "BlahBlah" will be send to your contact.
Note also that the text you've send will again be recieved (almost instantly) by you too.
Putting things together (in an very easy way; thus far from foolproof):
js code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind) {
if (MsgKind === 1 | MsgKind === 6) {
if (Message === "/DoTheMacarena") {
if (Origin === Messenger.MyName){
Debug.Trace("command send")
} else {
Debug.Trace("command received")
}
return ""
}
}
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
if (Message = "Hello World") {
return "/DoTheMacarena"
}
}
- If the user types "Hello World", then the command "/DoTheMacarena" is send to your contact (your contact WILL see "/DoTheMacarena").
- Since you also recieve your own sent text, the command "/DoTheMacarena" will be send to you also. And thus it is in the RecievedMessage event that you can change the _displayed_ text to an empty line.
But note that this changed displayed text is only on YOUR side. And also note that there will be a line shown, eventhough you changed the text to an empty line; you can not discard it or hide the chat line completely.
---
I very very strongly suggest to read the help that comes with the scripting engine and especially the help about the two events shown above (choose "Scripting Documentation" from the "Files" menu in the script editor).
---------
quote:
Originally posted by Hen
It is very rare here to receive zero replies....
Is it impossible or is it too simple that no one replied ...
Not really, there are a lot of threads with no replies. Anyways, be more patient. This forum is very active, as you know, which means a lot of threads are created all the time, meaning an older message will quickly drop down the list of new threads. Give it a few more days (instead of just 1) in the futur... Also, on this forum it is custom to not reply with stuff like "I don't know". So people who don't know or can't answer a question will not spam a thread with non-helpfull posts; doesn't mean your post isn't read though.