What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [release] Only Allowed Email can sign-in

[release] Only Allowed Email can sign-in
Author: Message:
The Brain
Junior Member
**

Avatar

Posts: 49
Reputation: 1
– / Male / Flag
Joined: Jan 2003
RE: RE: [release] Only Allowed Email can sign-in
quote:
Originally posted by Arsenal
Or to shorten the script. You can just use an array like so..

function OnEvent_Signin(Email)
{
var emails = new Array("account1@live.com","account2@live.com","etc..")
for(i=0; i<emails.length; i++){
if(Email == emails[i])
{
var Message = "Hello :\n " + Messenger.MyName + "!";
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("Allowed", Message,'notify.mp3');
}
else
{
var Message = "Access Denied " + "!";
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("Not Allowed", Message,'notify.mp3');
Messenger.signout();
}
}
}


It should work. I havent tested it though.


No that won't work. If your account is say "account1@live.com" then the first time through the loop it will approve you, but then it will go through the loop again, and your email address is not account2@live.com, and so it will not approve you and sign you out.

If your account is the last one in the array, I still don't think it would work, as you will have already been signed out in the previous iterations of the loop.

If you wanted to do it like this, I think the simplest way would be to have a separate function whichchecks if your email address is in the stored array. It should return true if your email address is found, or return false if it goes through the whole loop.

eg
code:

function checkAddress(Email)
{
    var emails = new Array("account1@live.com","account2@live.com","etc..")
    for(i=0; i<emails.length; i++){
        if(Email == emails[i])
        {
            return true;
        }


    }
    return false;
}


of course, I made the same mistake as you, and didn't test it....

This post was edited on 06-27-2006 at 02:10 AM by The Brain.
06-27-2006 02:09 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[release] Only Allowed Email can sign-in - by zaui on 06-25-2006 at 05:20 AM
RE: Only Allow Email can sign-in - by Skyler0 on 06-25-2006 at 05:24 AM
RE: Only Allow Email can sign-in - by Chestah on 06-25-2006 at 05:24 AM
RE: Only Allow Email can sign-in - by FineWolf on 06-25-2006 at 05:24 AM
RE: RE: Only Allow Email can sign-in - by zaui on 06-25-2006 at 05:29 AM
RE: Only Allow Email can sign-in - by NiteMare on 06-25-2006 at 05:29 AM
RE: Only Allow Email can sign-in - by markee on 06-25-2006 at 06:28 AM
RE: Only Allow Email can sign-in - by zaui on 06-25-2006 at 07:45 AM
RE: Only Allow Email can sign-in - by MX-G on 06-25-2006 at 07:49 AM
RE: [release] Only Allowed Email can sign-in - by Apola Silverstone on 06-26-2006 at 04:55 PM
RE: [release] Only Allowed Email can sign-in - by Skyler0 on 06-26-2006 at 05:29 PM
RE: [release] Only Allowed Email can sign-in - by Apola Silverstone on 06-26-2006 at 05:35 PM
RE: [release] Only Allowed Email can sign-in - by Arsenal on 06-26-2006 at 08:35 PM
RE: RE: [release] Only Allowed Email can sign-in - by The Brain on 06-27-2006 at 02:09 AM
RE: [release] Only Allowed Email can sign-in - by Apola Silverstone on 06-27-2006 at 02:12 AM
RE: [release] Only Allowed Email can sign-in - by zaui on 06-29-2006 at 04:50 PM
RE: [release] Only Allowed Email can sign-in - by Thor on 06-29-2006 at 05:18 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