What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help about script

Help about script
Author: Message:
nuwanda
New Member
*

Avatar

Posts: 8
Joined: Jun 2006
O.P. Huh?  Help about script
Hi, I am new to that job..I want to write a script that creates a time limit when user signs in. (Just for practising,itsnt useable :) )
I wrote something like that , but it doesnt work ;



function OnEvent_Signin(Mail)
{
        var time;
        var Message = "Your time has started!";
        MsgPlus.DisplayToast("Notice",Message);
        MsgPlus.AddTimer(time,600)       
}

function    OnEvent_Timer(time)
{
        var Message = "Your time is over..Signing out!";
        MsgPlus.DisplayToast("",Message);
Signout();
}



I know i am just a starter,so there can be silly codes up there :D...

Thanks for your help.

This post was edited on 06-25-2006 at 07:57 AM by nuwanda.
06-25-2006 07:55 AM
Profile E-Mail PM Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: Help about script
http://www.msgpluslive.net/scripts/browse/index.php?act=view&id=13
code:
AddTimer(
    [string] TimerId,
    [number] Elapse
);

TimerId
[string] Unique string identifying the new timer. Every script can create up to 100 timers, each one with their own unique identifier. When a timer event occurs, the Id is passed as parameter. You can specify any string you want for TimerId apart from an empty string. Different scripts can use identical TimerId without worrying of possible conflicts.


In other words: NOT an empty variable.

code:
Elapse
[number] Amount of time that has to elapse, in milliseconds, before the event is fired. This number needs to be in the range of 100 to 86,4000,000 (one day).

You probably meant it to be 600 seconds, right? Not milliseconds? Try 600000.

code:
OnEvent_Timer(
    [string] TimerId
);


TimerId
[string] Identifier of the timer as specified in MsgPlus::AddTimer.


Do a check to make sure TimerId is the id you specified when you created the timer.

Also, it's Messenger.Signout();

Refer to the docs often.

Fixed code (untested)

code:
function OnEvent_Signin(Mail)
{
  var Message = "Your time has started!";
  MsgPlus.DisplayToast("Notice", Message);
  MsgPlus.AddTimer("signin",600000)
}

function OnEvent_Timer(timerid)
{
  if (timerid == "signin")
  {
    var Message = "Your time is over..Signing out!";
    MsgPlus.DisplayToast("",Message);
    Messenger.Signout();
  }
}


The previous sentence is false. The following sentence is true.
06-25-2006 08:07 AM
Profile PM Find Quote Report
nuwanda
New Member
*

Avatar

Posts: 8
Joined: Jun 2006
O.P. RE: Help about script
Thanks a lot..it worked ;) i need to practice more..I will be there again with a lot of questions :D Thanks
06-25-2006 08:15 AM
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