Shoutbox

"" return value for event ReceiveMessage - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: "" return value for event ReceiveMessage (/showthread.php?tid=61756)

"" return value for event ReceiveMessage by Mr. Bougo on 06-27-2006 at 04:22 PM

When you do something like that:

code:
OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,MessageMessageKind) {
    return "";
}

It does

quote:
Mr. Bougo says:






It would be better if it didnt display any message, nope?
RE: "" return value for event ReceiveMessage by mathieumg on 06-27-2006 at 04:26 PM

quote:
Originally posted by Scripting documentation

Because Messenger Plus! analyses messages received only when they reach the chat window...It is important to remember that the new message cannot be longer than the original one (Message.length) and will be cut if necessary. Also, Messenger will not re-parse the message for emoticons codes.


All of this because Plus! intercepts the message in the chat window itself, not before.
RE: "" return value for event ReceiveMessage by upsfeup on 06-27-2006 at 04:27 PM

Yes.. it would..

and about just return? with no value?


RE: "" return value for event ReceiveMessage by Mr. Bougo on 06-27-2006 at 04:31 PM

Huh...


It's a simplified script, lol...


It would be useful for ignoring messages, like the /xignore feature in Stuffplug does... But if i return ""; it shows the "Mr. Bougo says:" instead of nothing...


The test script i made was:

code:
OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,MessageMessageKind) {
    Debug.Trace("Message received from " + Origin + ": " + Message)
    return "";
}
(it was only a test script, heh)

And it showed me the "Mr. Bougo says:", and i think it would be better if it showed nothing... Maybe in next release of MP!L :)



EDIT: Upseuf, lets try this...


No, it doesnt work...

I tried null too, and i tried to var temp = new String(); and return temp; and it didnt work, all those tests returns Message like if the script was disabled, but it isnt, and it doesnt bug... Only the return ""; works and it displays "Mr. Bougo says:"


EDIT2: Mathieumg, if MP!L can remove a line in the textbox, i think it can remove the line above too, so maybe Patchou will modify the return function for the ReceiveMessage event :)


EDIT3 (lol that post is getting long): If it can't, I'll wait for Stuffplug 3 release and use ChatWnd.SendMessage("/xignore"); heh, no problem :)
RE: "" return value for event ReceiveMessage by matty on 06-27-2006 at 04:47 PM

Don't return "":

use

code:
return false;

RE: "" return value for event ReceiveMessage by Mr. Bougo on 06-27-2006 at 08:05 PM

Tried it too, doest work :p


RE: "" return value for event ReceiveMessage by Ezra on 06-27-2006 at 08:07 PM

Because it only changes the message, so the username says: part stays unchanged


RE: "" return value for event ReceiveMessage by can16358p on 06-27-2006 at 08:21 PM

Just as idea, I'm not sure if that's readonly or not, but if not, try changing the message kind and see what happens.


RE: "" return value for event ReceiveMessage by deAd on 06-27-2006 at 08:44 PM

You can't change the message kind...


RE: "" return value for event ReceiveMessage by matty on 06-27-2006 at 08:49 PM

Wait I think your using the wrong function...

The OnEvent_ChatWndSendMessage event is fired every time the current user sends a message in a chat window.


RE: "" return value for event ReceiveMessage by Mr. Bougo on 06-28-2006 at 04:43 AM

Huh Matty, who are you talking to?

Coz i've never talked about ChatWndSendMessage heh :p