What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] retrieve contact status

Pages: (2): « First [ 1 ] 2 » Last »
[?] retrieve contact status
Author: Message:
Cartox
Junior Member
**

Avatar
+1

Posts: 87
Reputation: 1
37 / Male / Flag
Joined: Jun 2004
O.P. [?] retrieve contact status
Hi,I think the folowing code is from the Open notifier Beta 0.5 from nx01rules.googlepages.com/
Is still use this code because it stil works (i know it isn't reliable :D)

I would like  the popup that's created to show the contact's status aswel.

so it would be somethin like "Contact (Away) has opened a conversation/session with you."

I've tried by adding Contact.Status after contact.name
but it didn't work.

do you have to make a list with the name's of the status somewhere?

code:
var PluginObj;

function OnEvent_Initialize(MessengerStart)
{
    if ( PluginObj == null )
    {
        OnEvent_Signin(Messenger.MyEmail);
    }
}

function OnEvent_Uninitialize(MessengerExit)
{
    PluginObj = null;
}

function SetWindowText(hWnd, sText)
{
    Interop.Call('user32', 'SetWindowTextW', hWnd, sText);
}

function OnWndOpenedEvent_EditTextChanged(PlusWnd,ControlId)
{
    if ( PlusWnd.GetControlText(ControlId) != "" )
    {
        var Contacts = Messenger.MyContacts;
        var Contact = Contacts.GetContact(PlusWnd.GetControlText(ControlId));
        if ( Contact == null )
        {
            MsgPlus.DisplayToast("Window Opened", PlusWnd.GetControlText(ControlId) + " has opened a conversation with you.", "", "ToastCallback", PlusWnd.GetControlText(ControlId));
        }
        else
        {
            MsgPlus.DisplayToast("Window Opened", Contact.Name + " has opened a conversation with you.", "", "ToastCallback", Contact.Email);
        }
        PlusWnd.SetControlText(ControlId, "");
    }
}

function ToastCallback(Param)
{
    Messenger.OpenChat(Param);
}

function LoadPlugin_VB(ProgId, CurrentEmail, OpenTextControlhWnd)
{
    PluginObj = new ActiveXObject(ProgId);
    if(PluginObj)
    {
        if(PluginObj.Initialize(8, CurrentEmail + "|" + OpenTextControlhWnd, undefined) == false)
        {
            MsgPlus.DisplayToast("Open Notifier", "Notifier was unable to load for an unknown reason");
        }
    }
}

function OnEvent_Signin(Email)
{
    var pOpenWindow = MsgPlus.CreateWnd("Opened.xml","WndOpened",1);
    SetWindowText(pOpenWindow.Handle, Email + "MSGPLNOTIFOPEN");

    LoadPlugin_VB("MSNWON.WindowNotifier", Email, pOpenWindow.GetControlHandle("Edt1"), 0);
}

function OnEvent_Signout(Email)
{
    PluginObj = null;
}


This post was edited on 12-08-2006 at 12:43 PM by Cartox.
[Image: cartoxbanr.jpg]

The statement below is True.
The statement above is False.
12-08-2006 10:12 AM
Profile PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [?] retrieve contact status
Contact.Status returns numerical values for each status. You'll have to replace 'em [Image: msn_tongue.gif].
code:
Status = new Array('Unknown', 'Offline', 'Unknown', 'Online', 'Busy', 'Be Right Back', 'Idle', 'Away', 'In a Call', 'Out to Lunch');
Status[Contact.Status]
That should do it [Image: msn_happy.gif].
12-08-2006 10:25 AM
Profile E-Mail PM Web Find Quote Report
Cartox
Junior Member
**

Avatar
+1

Posts: 87
Reputation: 1
37 / Male / Flag
Joined: Jun 2004
O.P. RE: [?] retrieve contact status
thx, but can you help me a little more :$
Where to place that code and can i just ad

code:
MsgPlus.DisplayToast("Window Opened", Contact.Name + Contact.status + " has opened a conversation with you.", "", "ToastCallback", Contact.Email);
to it ?(contact.status)
the only script i ever made was to jump online a couple of times :)

This post was edited on 12-08-2006 at 10:40 AM by Cartox.
[Image: cartoxbanr.jpg]

The statement below is True.
The statement above is False.
12-08-2006 10:39 AM
Profile PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [?] retrieve contact status
code:
var PluginObj;
Status = new Array('Unknown', 'Offline', 'Unknown', 'Online', 'Busy', 'Be Right Back', 'Idle', 'Away', 'In a Call', 'Out to Lunch');

function OnEvent_Initialize(MessengerStart)
{
    if ( PluginObj == null )
    {
        OnEvent_Signin(Messenger.MyEmail);
    }
}

function OnEvent_Uninitialize(MessengerExit)
{
    PluginObj = null;
}

function SetWindowText(hWnd, sText)
{
    Interop.Call('user32', 'SetWindowTextW', hWnd, sText);
}

function OnWndOpenedEvent_EditTextChanged(PlusWnd,ControlId)
{
    if ( PlusWnd.GetControlText(ControlId) != "" )
    {
        var Contacts = Messenger.MyContacts;
        var Contact = Contacts.GetContact(PlusWnd.GetControlText(ControlId));
        if ( Contact == null )
        {
            MsgPlus.DisplayToast("Window Opened", PlusWnd.GetControlText(ControlId) + " has opened a conversation with you.", "", "ToastCallback", PlusWnd.GetControlText(ControlId));
        }
        else
        {
            MsgPlus.DisplayToast("Window Opened", Contact.Name + "("+Status[Contact.Status]+ ")" + " has opened a conversation with you.", "", "ToastCallback", Contact.Email);
        }
        PlusWnd.SetControlText(ControlId, "");
    }
}

function ToastCallback(Param)
{
    Messenger.OpenChat(Param);
}

function LoadPlugin_VB(ProgId, CurrentEmail, OpenTextControlhWnd)
{
    PluginObj = new ActiveXObject(ProgId);
    if(PluginObj)
    {
        if(PluginObj.Initialize(8, CurrentEmail + "|" + OpenTextControlhWnd, undefined) == false)
        {
            MsgPlus.DisplayToast("Open Notifier", "Notifier was unable to load for an unknown reason");
        }
    }
}

function OnEvent_Signin(Email)
{
    var pOpenWindow = MsgPlus.CreateWnd("Opened.xml","WndOpened",1);
    SetWindowText(pOpenWindow.Handle, Email + "MSGPLNOTIFOPEN");

    LoadPlugin_VB("MSNWON.WindowNotifier", Email, pOpenWindow.GetControlHandle("Edt1"), 0);
}

function OnEvent_Signout(Email)
{
    PluginObj = null;
}
Edited

This post was edited on 12-08-2006 at 10:58 AM by Felu.
12-08-2006 10:45 AM
Profile E-Mail PM Web Find Quote Report
Cartox
Junior Member
**

Avatar
+1

Posts: 87
Reputation: 1
37 / Male / Flag
Joined: Jun 2004
O.P. RE: [?] retrieve contact status
there seems to be a error on line 34, a "]" is missing
[Image: cartoxbanr.jpg]

The statement below is True.
The statement above is False.
12-08-2006 10:57 AM
Profile PM Web Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: [?] retrieve contact status
code:
var PluginObj;
Status = new Array('Unknown', 'Offline', 'Unknown', 'Online', 'Busy', 'Be Right Back', 'Idle', 'Away', 'In a Call', 'Out to Lunch');

function OnEvent_Initialize(MessengerStart)
{
if ( PluginObj == null )
{
OnEvent_Signin(Messenger.MyEmail);
}
}

function OnEvent_Uninitialize(MessengerExit)
{
PluginObj = null;
}

function SetWindowText(hWnd, sText)
{
Interop.Call('user32', 'SetWindowTextW', hWnd, sText);
}

function OnWndOpenedEvent_EditTextChanged(PlusWnd,ControlId)
{
if ( PlusWnd.GetControlText(ControlId) != "" )
{
var Contacts = Messenger.MyContacts;
var Contact = Contacts.GetContact(PlusWnd.GetControlText(ControlId));
if ( Contact == null )
{
MsgPlus.DisplayToast("Window Opened", PlusWnd.GetControlText(ControlId) + " has opened a conversation with you.", "", "ToastCallback", PlusWnd.GetControlText(ControlId));
}
else
{
MsgPlus.DisplayToast("Window Opened", Contact.Name + "("+Status[Contact.Status]+ ")" + " has opened a conversation with you.", "", "ToastCallback", Contact.Email);
}
PlusWnd.SetControlText(ControlId, "");
}
}

function ToastCallback(Param)
{
Messenger.OpenChat(Param);
}

function LoadPlugin_VB(ProgId, CurrentEmail, OpenTextControlhWnd)
{
PluginObj = new ActiveXObject(ProgId);
if(PluginObj)
{
if(PluginObj.Initialize(8, CurrentEmail + "|" + OpenTextControlhWnd, undefined) == false)
{
MsgPlus.DisplayToast("Open Notifier", "Notifier was unable to load for an unknown reason");
}
}
}

function OnEvent_Signin(Email)
{
var pOpenWindow = MsgPlus.CreateWnd("Opened.xml","WndOpened",1);
SetWindowText(pOpenWindow.Handle, Email + "MSGPLNOTIFOPEN");

LoadPlugin_VB("MSNWON.WindowNotifier", Email, pOpenWindow.GetControlHandle("Edt1"), 0);
}

function OnEvent_Signout(Email)
{
PluginObj = null;
}
fixed it for you
12-08-2006 10:58 AM
Profile PM Find Quote Report
Cartox
Junior Member
**

Avatar
+1

Posts: 87
Reputation: 1
37 / Male / Flag
Joined: Jun 2004
O.P. RE: [?] retrieve contact status
thx, felu and nana for the help so far
but it doesn't seem to work now either

quote:
Function called: OnEvent_Uninitialize
Script has been stopped
Script is starting
Script is now loaded and ready
Function called: OnEvent_Initialize
Error: Object missing.
       Line: 60. Code: -2146827864.
Function OnEvent_Initialize returned an error. Code: -2147352567

[Image: cartoxbanr.jpg]

The statement below is True.
The statement above is False.
12-08-2006 11:07 AM
Profile PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [?] retrieve contact status
code:
var pOpenWindow = MsgPlus.CreateWnd("Opened.xml","WndOpened",1);
//Line 59
SetWindowText(pOpenWindow.Handle, Email + "MSGPLNOTIFOPEN");//Line60

Is the Window working?
12-08-2006 11:19 AM
Profile E-Mail PM Web Find Quote Report
Cartox
Junior Member
**

Avatar
+1

Posts: 87
Reputation: 1
37 / Male / Flag
Joined: Jun 2004
O.P. RE: [?] retrieve contact status
with the last modifictation i get this in the debug

code:
Script is starting
Script is now loaded and ready
Function called: OnEvent_Initialize
Error: Object vereist.
       Line: 60. Code: -2146827864.
Function OnEvent_Initialize returned an error. Code: -2147352567

no, no popup showing

edit: it was line 60 again srry


EDIT2:
Yea, it works
many thanks :D

i now see the problem also
i had created a new scrip but in that folder was no "opened.xml"

This post was edited on 12-08-2006 at 11:36 AM by Cartox.
[Image: cartoxbanr.jpg]

The statement below is True.
The statement above is False.
12-08-2006 11:23 AM
Profile PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [?] retrieve contact status
Here is the script. Download attachment :).

.plsc File Attachment: Open Notifier 0.5 BETA.plsc (38.96 KB)
This file has been downloaded 111 time(s).
12-08-2006 11:42 AM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« 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