What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » my first script any help would be appriciated..

my first script any help would be appriciated..
Author: Message:
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
RE: my first script any help would be appriciated..
quote:
Originally posted by CookieRevised
This will not work in all circumstances!

You have no control with this over the other scripts. Especially when you're executing multiple Messengers quickly after eachother, delays in loading (and loading Plus!, skins and scripts) will start to happen. This makes that another instance of this script might still be running (or still need to start running) by the time the 'main' script finishes. In other words, the 'main' script will remove the registry check before one of those other scripts get executed, and you're back to square one...

So, do not use a single boolean, instead you must keep track of what accounts have been signed in, or rather in the process of signing in because the actual sign in might fail.
How about this?

Javascript code:
// add to the top
var shell = new ActiveXObject("WScript.Shell");
 
// ...
 
function OnEvent_Initialize(MessengerStart)
{
    try {
        // value exists, check the count, write the new one
        var Count = shell.RegRead(MsgPlus.ScriptRegPath + "\\RunCount");
        shell.RegWrite(MsgPlus.ScriptRegPath + "\\RunCount", Count--, "REG_DWORD");
        if (Count === 0) {
            // we're finished, delete the (correct) key :)
            shell.RegDelete(MsgPlus.ScriptRegPath + "\\RunCount");
        }
        return false;
    } catch (error) {
        // not yet running, make a registry value, continue
        shell.RegWrite(MsgPlus.ScriptRegPath + "\\RunCount", emailList.length, "REG_DWORD");
    }
 
    // Check if there's anything to be done
    if(emailList.length > 0) {
        MsgPlus.AddTimer('windowDelayer', delayOpenWnd);
    }
}
 
// ...


This post was edited on 07-03-2010 at 12:15 PM by whiz.
07-03-2010 11:35 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
my first script any help would be appriciated.. - by Yustme on 02-13-2010 at 03:25 PM
RE: my first script any help would be appriciated.. - by roflmao456 on 02-13-2010 at 04:43 PM
RE: RE: my first script any help would be appriciated.. - by Yustme on 02-13-2010 at 04:58 PM
RE: my first script any help would be appriciated.. - by Matti on 02-13-2010 at 07:02 PM
RE: RE: my first script any help would be appriciated.. - by Yustme on 02-13-2010 at 07:18 PM
RE: my first script any help would be appriciated.. - by Yustme on 02-14-2010 at 12:02 AM
RE: my first script any help would be appriciated.. - by Matti on 02-14-2010 at 11:04 AM
RE: RE: my first script any help would be appriciated.. - by Yustme on 02-14-2010 at 11:29 AM
RE: my first script any help would be appriciated.. - by petsas on 07-02-2010 at 01:49 PM
RE: my first script any help would be appriciated.. - by whiz on 07-02-2010 at 02:07 PM
RE: my first script any help would be appriciated.. - by CookieRevised on 07-03-2010 at 11:11 AM
RE: my first script any help would be appriciated.. - by whiz on 07-03-2010 at 11:35 AM
RE: RE: my first script any help would be appriciated.. - by CookieRevised on 07-03-2010 at 11:56 AM
RE: my first script any help would be appriciated.. - by petsas on 07-05-2010 at 11:13 AM
RE: my first script any help would be appriciated.. - by matty on 07-05-2010 at 01:26 PM
RE: my first script any help would be appriciated.. - by petsas on 07-05-2010 at 01:42 PM
RE: my first script any help would be appriciated.. - by Matti on 07-05-2010 at 02:26 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