What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » What's wrong with my code?

What's wrong with my code?
Author: Message:
xVengeance
New Member
*


Posts: 2
Joined: Mar 2009
O.P. What's wrong with my code?
Hi, I'm new to MsgPlus! Scripting and I was wondering what was wrong with my code.

What it's SUPPOSED to do is get the number of active chats and display it in your Display Message.

But seeing as how the Documentation was so wonderful in not showing any examples, I'm going to need some 3rd party help.

code:
function OnEvent_Initialize(MessengerStart)
{
    MsgPlus.AddTimer("WindowCount", 5000);
    var Windows = Messenger.CurrentChats;
    Messenger.MyPersonalMessage ("Chats open: " + Windows);
}

function OnEvent_Uninitialize(MessengerExit)
{
   
}

function OnEvent_Timer(WindowCount)
{
    MsgPlus.AddTimer("WindowsCounts", 5000);
    var Windows = Messenger.CurrentChats;
    Messenger.MyPersonalMessage ("Chats open: " + Messenger.CurrentChats);
}

function OnEvent_Timer(WindowsCounts)
{
    var Windows = Messenger.CurrentChats;
    Messenger.MyPersonalMessage ("Chats open: " + Messenger.CurrentChats);
}

This post was edited on 03-18-2009 at 03:21 AM by xVengeance.
03-18-2009 03:21 AM
Profile E-Mail PM Find Quote Report
John Anderton
Elite Member
*****

Avatar

Posts: 3908
Reputation: 80
37 / Male / Flag
Joined: Nov 2004
Status: Away
RE: What's wrong with my code?
code:
function OnEvent_Initialize(MessengerStart)
{
    MsgPlus.AddTimer("WindowCount", 5000);
    var Windows = Messenger.CurrentChats;
    Messenger.MyPersonalMessage ("Chats open: " + Windows);
}

function OnEvent_Uninitialize(MessengerExit)
{
   
}

function OnEvent_Timer(WindowCount)
{
    MsgPlus.AddTimer("WindowsCount", 5000);
    var Windows = Messenger.CurrentChats;
    Messenger.MyPersonalMessage ("Chats open: " + Messenger.CurrentChats);
}

Unless you want the script to set your PSM only three times (on initialize, at 5000 and 10000 seconds), you should consider updating your script ;)
(for now, I'm assuming Messenger.CurrentChats shows the chat window count. I can't check since I don't have messenger and the Plus! documentation here :P)
[

KarunAB.com
]

[img]http://gamercards.exophase.com/459422.png[
/img]
03-18-2009 04:27 AM
Profile E-Mail PM Web Find Quote Report
xVengeance
New Member
*


Posts: 2
Joined: Mar 2009
O.P. RE: What's wrong with my code?
I just want to set a timer to make it update every 5-10 seconds.
03-18-2009 05:40 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: What's wrong with my code?
js code:
function OnEvent_Initialze(bMessengerStart) {
    if (Messenger.MyStatus < 2) return false;
    Messenger.MyPersonalMessage = 'Chats open: '+Messenger.CurrentChats.Count);
}

function OnEvent_ChatWndCreated(pChatWnd) {
    Messenger.MyPersonalMessage = 'Chats open: '+Messenger.CurrentChats.Count);
}

function OnEvent_ChatWndDestroyed(pChatWnd) {
    Messenger.MyPersonalMessage = 'Chats open: '+Messenger.CurrentChats.Count-1);
}

That would do it...

This post was edited on 03-18-2009 at 05:44 AM by matty.
03-18-2009 05:42 AM
Profile E-Mail PM Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: What's wrong with my code?
I think I made a script in the past that does exactly this.
yep, i did.
http://www.msgpluslive.com/scripts/view/388-ChatCount/
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
03-18-2009 06:47 AM
Profile 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