Replacing Words from an Array - 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: Replacing Words from an Array (/showthread.php?tid=88025) Replacing Words from an Array by KooKas on 12-31-2008 at 07:18 AM
Hello, this is my first post here, I'm just going to ask how I sort this out. code: RE: Replacing Words from an Array by Matti on 12-31-2008 at 09:29 AM
ChatWnd.EditText is the text currently being typed by the user. Because you're using the OnEvent_ChatWndSendMessage, this will be empty as the message is already about to be sent and therefore the input area has been cleared. To change the message to be sent, you need to return the modified message at the end of your function. code:Have a look at the changes and the explanation and make sure you understand what went wrong, so you can learn from it and won't make the same mistake again. RE: Replacing Words from an Array by KooKas on 12-31-2008 at 12:09 PM Ahah, thank you very much, Matti. Hopefully I won't make the mistake again RE: Replacing Words from an Array by matty on 12-31-2008 at 03:21 PM
quote:Everything you stated in your post is correct except for the statement I am quoting. During the OnEvent_ChatWndSendMessage function the pChatWnd.EditText property is still populated. It is cleared out once the function succeeds. Such things as the following is made possible because of this: js code: The reason this is done like this is because Messenger Plus! will parse the text before passing it to the function therefore to get the native text in the Chat Window edit box it is done like that. However the only problem with the above code is that the pChatWnd.EditText property is passed incorrectly therefore any emoticons to be sent (for instance: (!VER)) will show up as (!VER). I don't know if Patchou is aware of this. I will mention it next time I see him online. Cheers! And also the code can be cut down: js code: RE: Replacing Words from an Array by KooKas on 12-31-2008 at 11:06 PM Yeah, I normally do that when programming in ActionScript (a language very similar to J- and Java- script, but I wasn't really worrying about neatness, more about just getting it to work D: But yes, thank you, matty and Matti. |