What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help - I'm new to scripting!

Help - I'm new to scripting!
Author: Message:
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
37 / Male / Flag
Joined: Jul 2005
RE: RE: Help - I'm new to scripting!
quote:
Originally posted by whiz
Okay, I've now got this new sign-in code:
code:
...
But whether the script is "enabled" or "disabled" (as set in the script menu), it always comes up!  Any ideas?

That's because of the way the menu function you posted earlier was coded.
JScript code:
function OnEvent_MenuClicked(sMenuId)
{
    if(sMenuId=="Enable")
    {
        [b]var[/b] bEnabled = true;        var Message = "Toaster has just been enabled!";
        Message = MsgPlus.RemoveFormatCodes(Message);
        MsgPlus.DisplayToast("Toaster", Message);
        Debug.Trace("Toaster | Enable");
    }
    if(sMenuId=="Disable")
    {
        [b]var[/b] bEnabled = false;        var Message = "Toaster has just been disabled!";
        Message = MsgPlus.RemoveFormatCodes(Message);
        MsgPlus.DisplayToast("Toaster", Message);
        Debug.Trace("Toaster | Disable");
    }
}

The bolded var statements redeclare the bEnabled variable as a local variable, so their values aren't saved to the global variable.
In other words; this menu function does not change the script's status in any way.

Remove both bolded "var"s (so the lines say "bEnabled = true/false;") and you should be fine.
Man is least himself when he is in his own person. Give him a mask and he will tell you the truth. (Oscar Wilde)
12-08-2008 12:39 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help - I'm new to scripting! - by whiz on 11-15-2008 at 03:12 PM
RE: Help - I'm new to scripting! - by matty on 11-25-2008 at 04:31 PM
RE: Help - I'm new to scripting! - by whiz on 11-26-2008 at 08:16 PM
RE: Help - I'm new to scripting! - by matty on 11-26-2008 at 08:23 PM
RE: Help - I'm new to scripting! - by whiz on 11-26-2008 at 09:01 PM
RE: Help - I'm new to scripting! - by matty on 11-27-2008 at 02:29 PM
RE: Help - I'm new to scripting! - by whiz on 11-27-2008 at 07:37 PM
RE: Help - I'm new to scripting! - by matty on 11-27-2008 at 07:38 PM
RE: Help - I'm new to scripting! - by whiz on 12-07-2008 at 11:25 AM
RE: Help - I'm new to scripting! - by Matti on 12-07-2008 at 11:29 AM
RE: RE: Help - I'm new to scripting! - by NanoChromatic on 12-07-2008 at 11:36 AM
RE: Help - I'm new to scripting! - by Matti on 12-07-2008 at 12:26 PM
RE: RE: Help - I'm new to scripting! - by NanoChromatic on 12-07-2008 at 02:08 PM
RE: Help - I'm new to scripting! - by whiz on 12-07-2008 at 04:06 PM
RE: RE: Help - I'm new to scripting! - by Jesus on 12-08-2008 at 12:39 AM
RE: Help - I'm new to scripting! - by whiz on 12-08-2008 at 07:49 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