What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [help] my first script..

[help] my first script..
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [help] my first script..
You can save the original personal message first in a variable, like this:
code:
function OnEvent_Signin() {
var originalPSM = Messenger.MyPersonalMessage;
}
Also, I recommend to use a switch case block instead of using every time if elseif. It makes the code easier to read. ;)
Here's a simplified version for your script:
code:
function OnEvent_MyStatusChange(Stat) {
switch(Stat) {
    //Appear Offline
    case 2:
    Messenger.MyPersonalMessage = "I'm appearing offline - " + originalPSM;
    break;
    //Online
    case 3:
    Messenger.MyPersonalMessage = "Online - " + originalPSM;
    break;
    //Busy
    case 4:
    Messenger.MyPersonalMessage = "I'm busy - " + originalPSM;
    break;
    //Be Right Back
    case 5:
    Messenger.MyPersonalMessage = "I will be right back - " + originalPSM;
    break;
    //Idle
    case 6:
    Messenger.MyPersonalMessage = "Idle - " + originalPSM;
    break;
    //Away
    case 7:
    Messenger.MyPersonalMessage = "I'm away - " + originalPSM;
    break;
    //In a call
    case 8:
    Messenger.MyPersonalMessage = "Shh! I'm in a call - " + originalPSM;
    break;
    //In a call
    case 9:
    Messenger.MyPersonalMessage = "Mmm, I'm eating! - " + originalPSM;
    break;
}
As you can see, every case block ends in a break statement. This is because if you don't, it will execute all the other code too! :o

I hope that helps... :)

This post was edited on 06-26-2006 at 06:23 AM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-26-2006 06:22 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[help] my first script.. - by mltz2plz on 06-26-2006 at 05:58 AM
RE: [help] my first script.. - by Matti on 06-26-2006 at 06:22 AM
RE: RE: [help] my first script.. - by The Brain on 06-26-2006 at 03:26 PM
RE: [help] my first script.. - by mltz2plz on 06-26-2006 at 06:32 AM
RE: [help] my first script.. - by can16358p on 06-26-2006 at 07:19 AM
RE: [help] my first script.. - by mltz2plz on 06-26-2006 at 01:44 PM
RE: [help] my first script.. - by mltz2plz on 06-27-2006 at 09:49 AM


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