What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Solved] problems with a status checker script...

[Solved] problems with a status checker script...
Author: Message:
blessedguy
Skinning Contest Winner
*****


Posts: 1762
Reputation: 25
31 / Male / Flag
Joined: Jan 2008
O.P. [Solved] problems with a status checker script...
Ok, this is my first script =X
As first function, I want it to display a toast showing my current status, when I change it.
For example. I'm appearing offline, then I change my status to online, want the script to display a toast saying; "Status: Online"

I've already discovered how to do it... but the problem is the it always shows my PREVIOUS status, not the current one.
This is what happens: I'm appearing offline, if I set my status to online, it shows "Status: Appearing Offline". After it, if i change my status again, this time to away, for example, it will display "Status: Online".

Any tips? =/
i'm using this code:
code:
function OnEvent_MyStatusChange(NewStatus)
{
    if(Messenger.MyStatus == "2")
    {
        var Message = "Status: Appearing Offline";
        MsgPlus.DisplayToast("", Message);
    }
    if(Messenger.MyStatus == "3")
    {
        var Message = "Status: Online";
        MsgPlus.DisplayToast("", Message);
    }
    if(Messenger.MyStatus == "4")
    {
        var Message = "Status: Busy";
        MsgPlus.DisplayToast("", Message);
    }
    if(Messenger.MyStatus == "5")
    {
        var Message = "Status: Be Right Back";
        MsgPlus.DisplayToast("", Message);
    }
    if(Messenger.MyStatus == "6")
    {
        var Message = "Status: Idle";
        MsgPlus.DisplayToast("", Message);
    }
    if(Messenger.MyStatus == "7")
    {
        var Message = "Status: Away";
        MsgPlus.DisplayToast("", Message);
    }
    if(Messenger.MyStatus == "8")
    {
        var Message = "Status: In a Call";
        MsgPlus.DisplayToast("", Message);
    }
    if(Messenger.MyStatus == "9")
    {
        var Message = "Status: Out to Lunch";
        MsgPlus.DisplayToast("", Message);
    }
}
(by the way, if someone wants to know, I'm doing this script to avoid selecting the wrong status. For example, setting status to Online when I want to change it to busy... also to confirm status has changed when using a skin with "Quick status Change" [as i call it]/ "Status Shortcuts" [as guena calls it])

This post was edited on 01-21-2009 at 06:43 PM by blessedguy.
[Image: Empty.png]
01-21-2009 06:17 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Help] problems with a status checker script...
Messenger.MyStatus will show you the current status. OnEvent_MyStatusChange is called before the status is changed that is why the Parameter NewStatus is there. If you replace Messenger.MyStatus with just NewStatus it will be fine :).

Also a few points to note. NewStatus and Messenger.MyStatus are integers not strings... do not put quotes around the values or else it will take more computing cycles to convert it to the proper type.

Also your code could be cleaned up... a lot:
Javascript code:
function OnEvent_MyStatusChange(NewStatus) {
    var oStatus = {
                    2 : 'Appearing Offline',
                    3 : 'Online',
                    4 : 'Busy',
                    5 : 'Be Right Back',
                    6 : 'Idle',
                    7 : 'Away',
                    8 : 'In a Call',
                    9 : 'Out to Lunch'
                  }
                 
    MsgPlus.DisplayToast('', 'Status: '+oStatus[NewStatus]);
}


This post was edited on 01-21-2009 at 06:33 PM by matty.
01-21-2009 06:30 PM
Profile E-Mail PM Find Quote Report
blessedguy
Skinning Contest Winner
*****


Posts: 1762
Reputation: 25
31 / Male / Flag
Joined: Jan 2008
O.P. RE: [Help] problems with a status checker script...
quote:
Originally posted by matty
Messenger.MyStatus will show you the current status. OnEvent_MyStatusChange is called before the status is changed that is why the Parameter NewStatus is there. If you replace Messenger.MyStatus with just NewStatus it will be fine :).

Also a few points to note. NewStatus and Messenger.MyStatus are integers not strings... do not put quotes around the values or else it will take more computing cycles to convert it to the proper type.
phase one: understand what you said =P
phase two: apply changes

thanks matty =D

update: :S
Ok... i'll do what you suggested.

update 2:
it works =D
thnaks a lot

This post was edited on 01-21-2009 at 06:38 PM by blessedguy.
[Image: Empty.png]
01-21-2009 06:35 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Help] problems with a status checker script...
quote:
Originally posted by blessedguy
phase one: understand what you said =P
What part confused you and I will explain it.
01-21-2009 06:37 PM
Profile E-Mail PM Find Quote Report
blessedguy
Skinning Contest Winner
*****


Posts: 1762
Reputation: 25
31 / Male / Flag
Joined: Jan 2008
O.P. RE: [Help] problems with a status checker script...
it wasn't confusing... It's because i'm not used to scripting  yet, so I still have to think a lot before figure out what is what

By the way, if I want to add an interface window that lets the user control what text will be show in the toast (for example, changing the default appear offline string to "Aparecer Offline") i'd use PlusWnd.GetControlText ?

This post was edited on 01-21-2009 at 06:49 PM by blessedguy.
[Image: Empty.png]
01-21-2009 06:39 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Solved] problems with a status checker script...
quote:
Originally posted by blessedguy
it wasn't confusing... It's because i'm not used to scripting  yet, so I still have to think a lot before figure out what is what

By the way, if I want to add an interface window that lets the user control what text will be show in the toast (for example, changing the default appear offline string to "Aparecer Offline") i'd use PlusWnd.GetControlText ?
Yup
01-21-2009 07:44 PM
Profile E-Mail PM 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