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:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: my first script any help would be appriciated..
quote:
Originally posted by Yustme
Im trying to create a script which logs me in automatically in several accounts. I know there is one out there, but its bugged. Tried fixing it, but it's too messed up to understand it.

One of the reasons is because such scripts are complicated. There are many circumstances you need to take into account and it all requires deep knowledge of how the scripting engine works in order to make such a thing always working in all circumstances.

As you have already noticed, there are many things which will break this script or which will make it not work like you'd expect. And there are probably also things which you haven't noticed yet which might break it.

quote:
Originally posted by Yustme
Well the script executes all the messenger windows and signs in all the email addresses. Then it stops. It doesn't repeat this step for all instances of messenger.
That would actually be a bug in your script (the script you have, thus without the addition of Whiz) and a manifestation of how scripts are loaded in Messenger/Messenger Plus! and the delays, etc...

quote:
Originally posted by whiz
You could get the script to check for a registry key, and if it doesn't exist, it should create one because it is the first launch.
js code:
// add to the top
var shell = new ActiveXObject("WScript.Shell");

// ...

function OnEvent_Initialize(MessengerStart)
{
    try {
        // value exists, already running, exit now
        shell.RegRead(MsgPlus.ScriptRegPath + "\\IsRunning");
        return false;
    } catch (error) {
        // not yet running, make a registry value, continue
        shell.RegWrite(MsgPlus.ScriptRegPath + "\\IsRunning", "1");
    }

    // Check if there's anything to be done
    if(emailList.length > 0) {
        MsgPlus.AddTimer('windowDelayer', delayOpenWnd);
    } else {
        // finished, delete the registry key
        shell.RegDelete(MsgPlus.ScriptRegPath + "\\IsRunning");
    }
}

// ...

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.

quote:
Originally posted by Yustme
I got another quick question. Is there any way to check which email addresses have been logged in?
yes, but not directly. You either need to manipulate the other instances of Messenger directly as there is no easy way to 'talk' to other instances of the same script running in other Messengers.

Or you either need to find a common storage which is available for all other scripts at any time (eg: registry).

And if you go about it in a smart way, you can actually combine this with what I've suggested as a reply to Whiz' addition.

But either way, it is very tricky because signing in can take a very long time (even minutes). And it is only when you're signed in that you can 'store' the email account as being 'signed in'.

In other words, you can not use something like this to check what account has been signed in during the whole process of multiple sign ins. You can however use this to detect what accounts are already signed in *prior* to starting the whole multiple signin process, so you don't sign in an account twice (and thus sign out an account in one of the already existing Messenger instances).

To do this in the most easiest way:
In the OnEvent_SignIn() add (not replace) the email address to a registry string value if it doesn't already exist in that value (REG_MULTI_SZ is the preferred type, though REG_SZ will work too).

In the OnEvent_SignOut() you remove the email address again from that same registry value.

Then in your OnEvent_Timer() function you first check upon this registry value and only add accounts to the list if they don't exist in that registry value.

This method will prevent you from first signing out already signed in accounts, before signing them in again.

This post was edited on 07-03-2010 at 12:21 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-03-2010 11:11 AM
Profile 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