[?] retrieve contact status |
Author: |
Message: |
Cartox
Junior Member
+1
Posts: 87 Reputation: 1
37 / /
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 )
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.
The statement below is True.
The statement above is False.
|
|
12-08-2006 10:12 AM |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
Joined: Apr 2006
Status: Away
|
RE: [?] retrieve contact status
Contact.Status returns numerical values for each status. You'll have to replace 'em .
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 .
|
|
12-08-2006 10:25 AM |
|
|
Cartox
Junior Member
+1
Posts: 87 Reputation: 1
37 / /
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.
The statement below is True.
The statement above is False.
|
|
12-08-2006 10:39 AM |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
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 |
|
|
Cartox
Junior Member
+1
Posts: 87 Reputation: 1
37 / /
Joined: Jun 2004
|
O.P. RE: [?] retrieve contact status
there seems to be a error on line 34, a "]" is missing
The statement below is True.
The statement above is False.
|
|
12-08-2006 10:57 AM |
|
|
NanaFreak
Scripting Contest Winner
Posts: 1476 Reputation: 53
32 / /
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 |
|
|
Cartox
Junior Member
+1
Posts: 87 Reputation: 1
37 / /
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
The statement below is True.
The statement above is False.
|
|
12-08-2006 11:07 AM |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
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 |
|
|
Cartox
Junior Member
+1
Posts: 87 Reputation: 1
37 / /
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
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.
The statement below is True.
The statement above is False.
|
|
12-08-2006 11:23 AM |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
Joined: Apr 2006
Status: Away
|
RE: [?] retrieve contact status
Here is the script. Download attachment .
Attachment: Open Notifier 0.5 BETA.plsc (38.96 KB)
This file has been downloaded 113 time(s).
|
|
12-08-2006 11:42 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|
|