What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Scripts running on only one account when polygamy is enabled?

Scripts running on only one account when polygamy is enabled?
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Scripts running on only one account when polygamy is enabled?
First of all 'polygamy' (the word used to indicate "multiple messenger instances") means that you can log in with two or more accounts at the same time. Where each account has its own Messenger program.

So, you can't log in with two or more accounts into the same Messenger program. You need multiple Messenger programs to be running.

Then, you can't log in with the same account into two or more Messenger programs at the same time. You do need different accounts.

All this said, scripts run on every Messenger program. And disabling them in Plus!'s preferences for one account but enabling them for the other is not a good thing todo, as this wont work properly.

However, what you can do is programming the script in such a way that it will only react on stuff if the logged in user is X (in your case the bot) and not anybody else.

For this you need to check Messenger.MyEmail against the account email you whish the script to be 'running' with (it actually will run for the others too of course, but it wont do anything).

This check needs to be placed in each and every function your script has. Or you can use a global variable, etc...

in pseudo-code:
code:
// Make global variable
var bEnabled;

function OnEvent_SignIn(Email) {
    // Set boolean value according to the signed in user
    bEnabled = (Email === "mybot@mail.com")
}

function DoSomething {
    // Only do something if the signed in user is our bot
    if (bEnabled) {
        var Something = 1 + 1;
        Debug.Trace("I'm doing something :p");
    }
}

function DoSomethingElse {
    // Only do something if the signed in user is our bot
    if (bEnabled) {
        var Something = 2 * 2;
        Debug.Trace("I'm doing something else.");
    }
}
Of course this is extremely simplyfied. In a big script you need to take in account many other things too, like the possebility that another user can sign in, that scripts start to run before a user has signed in and continues to run if a user signs out. (All extremely important to take in account when using timers for example)...

This post was edited on 05-29-2007 at 04:43 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
05-29-2007 04:38 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Scripts running on only one account when polygamy is enabled? - by Macaroonny on 05-29-2007 at 03:52 PM
RE: Scripts running on only one account when polygamy is enabled? - by CookieRevised on 05-29-2007 at 04:38 PM
RE: Scripts running on only one account when polygamy is enabled? - by Macaroonny on 05-29-2007 at 04:55 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