What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » MsgPlus.ScriptRegPath| Problem :(

MsgPlus.ScriptRegPath| Problem :(
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: MsgPlus.ScriptRegPath| Problem :(
Javascript code:
var regPath;
var twitterusername;
var twittername;
var twittertimer;
 
function OnEvent_Initialize ( )
{
    if ( Messenger.MyStatus < STATUS_INVISIBILE ) return false;
 
    regPath = MsgPlus.ScriptRegPath + Messenger.MyUserId;
    /*
        this will never work and will always return false.
        Firstly: twittertimer is undefined. You have not assigned a value to it yet.
        Secondly load settings  is called after the check which will never get called because of the above statement
        Thirdly you are performing a bitwise comparison which means the types and value have to match.
        In this instance because WScript.Shell has no knowledge of different variable types it is loaded as a string.
        A string and a number do not match regardless if it is "0" and 0 because their types are different.
        Forthly is this the entire script? If so Shell is not declared anywhere...
    */

    if (twittertimer === 0) return false;
   
    loadsettings();
    MsgPlus.AddTimer("nextUpdate", twittertimer*60*1000);
}
 
function OnEvent_SigninReady ( sEmail ) {
    OnEvent_Initialize (  );
}
 
function loadsettings(){
    twittername = Shell.RegRead(regPath  +  "\\twitterusername");
    twittertimer= Shell.RegRead(regPath  +  "\\twittertimer");
}


I will post an update in a moment which should work.

Javascript code:
var twitterusername;
var twittername;
var twittertimer;
 
function OnEvent_Initialize ( )
{
    if ( Messenger.MyStatus < STATUS_INVISIBILE ) return false;
    loadsettings();  
    if ( twittertimer == 0 ) return false;
    MsgPlus.AddTimer( 'nextUpdate', twittertimer*60*1000 );
}
 
function OnEvent_SigninReady ( sEmail )
{
    OnEvent_Initialize (  );
}
 
function loadsettings ( )
{
    var Shell = new ActiveXObject ( 'WScript.Shell' );
    var regPath = MsgPlus.ScriptRegPath + Messenger.MyUserId;
   
    twittername = Shell.RegRead(regPath  +  '\\twitterusername');
    twittertimer = Shell.RegRead(regPath  +  '\\twittertimer');
}


This post was edited on 09-18-2009 at 02:39 PM by matty.
09-18-2009 02:36 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
MsgPlus.ScriptRegPath| Problem :( - by m0nst3rkill3r on 09-18-2009 at 11:49 AM
RE: MsgPlus.ScriptRegPath| Problem :( - by matty on 09-18-2009 at 12:35 PM
RE: MsgPlus.ScriptRegPath| Problem :( - by m0nst3rkill3r on 09-18-2009 at 02:16 PM
RE: MsgPlus.ScriptRegPath| Problem :( - by matty on 09-18-2009 at 02:36 PM
RE: MsgPlus.ScriptRegPath| Problem :( - by m0nst3rkill3r on 09-18-2009 at 02:42 PM
RE: MsgPlus.ScriptRegPath| Problem :( - by matty on 09-18-2009 at 02:56 PM
RE: MsgPlus.ScriptRegPath| Problem :( - by m0nst3rkill3r on 09-18-2009 at 02:58 PM
RE: MsgPlus.ScriptRegPath| Problem :( - by matty on 09-18-2009 at 03:05 PM
RE: MsgPlus.ScriptRegPath| Problem :( - by m0nst3rkill3r on 09-18-2009 at 03:07 PM
RE: MsgPlus.ScriptRegPath| Problem :( - by Matti on 09-18-2009 at 03:34 PM
RE: MsgPlus.ScriptRegPath| Problem :( - by m0nst3rkill3r on 09-18-2009 at 03:43 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