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!

Pages: (2): « First « 1 [ 2 ] Last »
Help - I'm new to scripting!
Author: Message:
NanoChromatic
Full Member
***

Avatar
I'm hot cause I'm fly

Posts: 212
Reputation: 7
29 / Male / Flag
Joined: Mar 2006
RE: RE: Help - I'm new to scripting!
quote:
Originally posted by Matti
That'll work, but not in the way you'd expect it. :P Therefore, in your OnEvent_Signin function, use
jscript code:
if(bEnabled)
since the way you do it now is by comparing it to the literal message "true" rather than the boolean value true. :)

Wow. I'm learning Pascal :D For Soldat.
Although I'm first going to try some nice scripts with WLM.
How would i start or is there a website that can help me?

Thx.
[Image: editbytbgux9.png]
12-07-2008 11:36 AM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Help - I'm new to scripting!
quote:
Originally posted by NanoChromatic
Wow. I'm learning Pascal :D For Soldat.
Why is that Pascal? :P It's just a regular boolean check: "if bEnabled (equals true), then do this."
quote:
Originally posted by NanoChromatic
Although I'm first going to try some nice scripts with WLM.
How would i start or is there a website that can help me?
Well, there are no real step-by-step tutorials on how to make script, since every script is different. There are some good resources like mpscripts.net. But remember that the first step in learning Plus! Live scripting is by having a look at the Scripting Documentation.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-07-2008 12:26 PM
Profile E-Mail PM Web Find Quote Report
NanoChromatic
Full Member
***

Avatar
I'm hot cause I'm fly

Posts: 212
Reputation: 7
29 / Male / Flag
Joined: Mar 2006
RE: RE: Help - I'm new to scripting!
quote:
Originally posted by Matti
quote:
Originally posted by NanoChromatic
Wow. I'm learning Pascal :D For Soldat.
Why is that Pascal? :P It's just a regular boolean check: "if bEnabled (equals true), then do this."
quote:
Originally posted by NanoChromatic
Although I'm first going to try some nice scripts with WLM.
How would i start or is there a website that can help me?
Well, there are no real step-by-step tutorials on how to make script, since every script is different. There are some good resources like mpscripts.net. But remember that the first step in learning Plus! Live scripting is by having a look at the Scripting Documentation.

I Didnt mean Thats pascal XD
I Just thought i would say im learning pascal :P
Haha, Anyway Thanks :).
[Image: editbytbgux9.png]
12-07-2008 02:08 PM
Profile E-Mail PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Help - I'm new to scripting!
Okay, I've now got this new sign-in code:
jscript code:
function OnEvent_Signin(Email)
{
    if(bEnabled)
    {
        var Message = "You have been signed in.";
        Message = MsgPlus.RemoveFormatCodes(Message);
        MsgPlus.DisplayToast("Toaster", Message);
        Debug.Trace("Toaster | UserSign-in [On]");
    }
    else
    {
        Debug.Trace("Toaster | UserSign-in [Off]");
    }
}

But whether the script is "enabled" or "disabled" (as set in the script menu), it always comes up!  Any ideas?
12-07-2008 04:06 PM
Profile E-Mail PM Find Quote Report
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
38 / 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
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Help - I'm new to scripting!
It works!  Thanks!  :)
12-08-2008 07:49 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« 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