What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Solved] Problem with ChatWndSendMessage event (i guess)

[Solved] Problem with ChatWndSendMessage event (i guess)
Author: Message:
Blaggi
New Member
*


Posts: 6
34 / Male / –
Joined: Jul 2006
O.P. [Solved] Problem with ChatWndSendMessage event (i guess)
Alright, so i got this PHP Miniature picture wich is always refreshed like a little chat..

I want MsgPlus to read the last entry from it, i prepared another PHP File for that, and the reading works with no problem

So here is the code:
code:
function OnEvent_Initialize(MessengerStart)
{
     MsgPlus.DisplayToast("Loaded", "Sigchat updater loaded!");
}

function OnEvent_Uninitialize(MessengerExit)
{
     MsgPlus.DisplayToast("Unloaded", "Sigchat updater unloaded!");
}

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
     if (Message == '#check') {
          var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          xmlhttp.open("GET", "http://flippeh.de/minichat_last.php", true);
          xmlhttp.onreadystatechange=function() {
               if (xmlhttp.readyState==4) {
                    Debug.Trace("Hi from success!");
                    Message = xmlhttp.responseText;
               }
          }
          xmlhttp.send('');
     }
     return false;
}

So, when i enter "#check", it actually sends "#check" into the conversation.
I want it to send the last entry from it, and not my keyword..

I tried return, and Message =, but nothing worked...

Would be really nice if someone could help me with it =)

This post was edited on 07-03-2006 at 09:28 PM by Blaggi.
07-03-2006 08:51 PM
Profile E-Mail PM Web Find Quote Report
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: Problem with ChatWndSendMessage event (i guess)
code:
if (Message == '#check') {
          var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          xmlhttp.open("GET", "http://flippeh.de/minichat_last.php", true);
          xmlhttp.onreadystatechange=function() {
               if (xmlhttp.readyState==4) {
                    Debug.Trace("Hi from success!");
                    Message = "";
                    //return xmlhttp.responseText;
               }
          }
          xmlhttp.send('');

        return Message;
     
}
     return false;
}


should work
07-03-2006 09:05 PM
Profile E-Mail PM Find Quote Report
Blaggi
New Member
*


Posts: 6
34 / Male / –
Joined: Jul 2006
O.P. RE: Problem with ChatWndSendMessage event (i guess)
Aaaaaaaaaaand it did work! =D
Thanks alot, so i need to return the Message variable at the end of the Eventfunction?

Okay, learned =P
07-03-2006 09:10 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On