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

[request] Last status timer
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [request] Last status timer
All I did was clean the code up so far, it looks like it should work.
Found an error just as I posted, GetHours() and GetMinutes() are functions of the Date() object in Javascript, you have to declare it before you can use it, hence the var mDate = new Date();

Also you cannot assign the PSM OnEvent_Signin as that is when the user is signing in, it would have to be OnEvent_SigninReady however once you signout the script is stopped until you sign back in so you will loose any variables that have been set.

code:
var PreviousToTimerPSM;
var mDate = new Date();

function OnEvent_Signout(Email) {
    Messenger.MyPersonalMessage = PreviousToTimerPSM; //restores the original PSM while signing out?
}

function OnEvent_SigninReady(Email) {
    PreviousToTimerPSM = Messenger.MyPersonalMessage; //retrieves the previous PSM once the user is signed in?
}

function OnEvent_MyStatusChange(NewStatus) {
    if( NewStatus == 3 ) {
        Messenger.MyPersonalMessage = PreviousToTimerPSM; //if it's online, no need to count.
    } else if( NewStatus == 6 ) {
        Messenger.MyPersonalMessage = "Estou ausente desde "+mDate.GetHours()+":"+mDate.GetMinutes();
    } else if( NewStatus == 4 ) {
        Messenger.MyPersonalMessage = "Estou ocupado desde "+mDate.GetHours()+":"+mDate.GetMinutes();
    } else if( NewStatus == 5 ) {
        Messenger.MyPersonalMessage = "Saí às "+mDate.GetHours()+":"+mDate.GetMinutes()+" mas volto logo!";
    } else if( NewStatus == 7 ) {
        Messenger.MyPersonalMessage = "Estou ausente desde "+mDate.GetHours()+":"+mDate.GetMinutes();
    } else if( NewStatus == 8 ) {
        Messenger.MyPersonalMessage = "Estou em uma ligação desde "+mDate.GetHours()+":"+mDate.GetMinutes();
    } else if( NewStatus == 9 ) {
        Messenger.MyPersonalMessage = "Estou almoçando desde "+mDate.GetHours()+":"+mDate.GetMinutes();
    }
}

This post was edited on 07-12-2007 at 08:40 PM by matty.
07-12-2007 08:33 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[request] Last status timer - by gdumitresco on 07-09-2007 at 06:02 PM
RE: [request] Last status timer - by matty on 07-09-2007 at 07:03 PM
RE: [request] Last status timer - by gdumitresco on 07-09-2007 at 07:17 PM
RE: [request] Last status timer - by gdumitresco on 07-12-2007 at 07:34 PM
RE: [request] Last status timer - by matty on 07-12-2007 at 08:33 PM
RE: [request] Last status timer - by pollolibredegrasa on 07-12-2007 at 08:39 PM
RE: [request] Last status timer - by gdumitresco on 07-12-2007 at 11:24 PM
RE: [request] Last status timer - by matty on 07-12-2007 at 11:52 PM
RE: [request] Last status timer - by gdumitresco on 07-12-2007 at 11:57 PM
RE: [request] Last status timer - by matty on 07-13-2007 at 12:07 AM
RE: [request] Last status timer - by gdumitresco on 07-13-2007 at 12:27 AM
RE: [request] Last status timer - by CookieRevised on 07-13-2007 at 09:05 AM
RE: [request] Last status timer - by gdumitresco on 07-13-2007 at 01:09 PM
RE: [request] Last status timer - by matty on 07-13-2007 at 01:37 PM
RE: [request] Last status timer - by gdumitresco on 07-13-2007 at 01:39 PM
RE: [request] Last status timer - by Deco on 07-13-2007 at 03:31 PM
RE: [request] Last status timer - by matty on 07-13-2007 at 08:03 PM
RE: [request] Last status timer - by gdumitresco on 07-13-2007 at 08:31 PM
RE: [request] Last status timer - by matty on 07-13-2007 at 08:45 PM
RE: [request] Last status timer - by gdumitresco on 07-14-2007 at 01:52 PM
RE: [request] Last status timer - by CookieRevised on 07-14-2007 at 02:19 PM


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