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

Pages: (3): « First « 1 2 [ 3 ] Last »
Is there a script to.....?
Author: Message:
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
31 / Male / Flag
Joined: Jul 2006
RE: RE: Is there a script to.....?
quote:
Originally posted by -!Felu!-
code:
var now;
var signouttime;
function GetDate(){
var D = new Date();
var Hours = Addzero(D.getHours());
var Seconds = Addzero(D.getSeconds());
var Minutes = Addzero(D.getMinutes());
var Seconds = Addzero(D.getSeconds());

var Day = Addzero(D.getDate());
var Month = Addzero(D.getMonth() + 1);
var Year = Addzero(D.getYear());

now = Month+'/'+Day+'/'+Year+' - '+Hours+'/'+Minutes+'/'+Seconds;
//Debug.Trace(now);
}

function Addzero(va)
{
if (va<10)
  {va="0" + va}
  return va
}

function OnEvent_Timer(TimerId)
{
switch (TimerId){
case "Signout":
if (Messenger.MyStatus != 0) {
GetDate();
if(now == signouttime){
Messenger.Signout();
}
}
MsgPlus.AddTimer("Signout", 1000);
break;
}
}
MsgPlus.AddTimer("Signout", 1000);

function OnEvent_ChatWndSendMessage(ChatWnd, Message){
if(Message.substr(0,12) == "/signouttime"){
signouttime = Message.substr(13)
Debug.Trace(signouttime);
return "";
}
}

function OnGetScriptCommands()
{
var commands = "<ScriptCommands>"
commands += "  <Command>"
commands += "    <Name>signouttime</Name>"
commands += "    <Description>Signs you out on the specified time and date.</Description>"
commands += "    <Parameters>MM/DD/YYYY - HH/MM/SS;</Parameters>"
commands += "  </Command>"
commands += "</ScriptCommands>"
return commands
}

!felu! made that. Use /signouttime MM/DD/YYYY - HH/MM/SS with full values to define the date and time to sign out on [Image: xso_cheesy.gif].

09-15-2006 08:07 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Is there a script to.....?
that script is serious faulty...

1) timers will still be triggered even if a different user has signed in
see "CookieRevised's reply to Is there a script to.....?"

2) time calculation is seriously faulty
a) signing out will not be done when the time has passed the set time
b) the output of now very highly depends on your system local time. This can be way different than mm/dd/yyyy - hh/mm/ss.
c) the output of getYear is a 2 digit number for years between 1900 and 1999, all other years produce a 4 digit number.
etc...

3) not taking in account user errors on the command line (I consider this minor though and not really a fault, more lazyness :p)

EDIT.
quote:
Originally posted by 134jimbodude
oh yes, sorry, should i delete that post?
unless all the above is fixed, so should Felu in my humble, but harsh (i know), opinion...

This post was edited on 09-15-2006 at 08:46 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-15-2006 08:32 PM
Profile PM Find Quote Report
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
31 / Male / Flag
Joined: Jul 2006
RE: Is there a script to.....?
oh yes, sorry, should i delete that post?
09-15-2006 08:34 PM
Profile E-Mail PM Find Quote Report
Pages: (3): « First « 1 2 [ 3 ] 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