Shoutbox

[release] Only Allowed Email can sign-in - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [release] Only Allowed Email can sign-in (/showthread.php?tid=61118)

[release] Only Allowed Email can sign-in by zaui on 06-25-2006 at 05:20 AM

I'm newbie in Script and i try to write the easy script to allow only my email can sign-in

with this script

code:
function OnEvent_Signin(Email)
{     
    if(Email == "account1@live.com" || "account2@hotmail.com") //Change to your Emai
     {
     var Message = "Hello :\n " + Messenger.MyName + "!";
    Message = MsgPlus.RemoveFormatCodes(Message);
     MsgPlus.DisplayToast("Allow", Message,'notify.mp3');
     }
     else
    {
    var Message = "Access Deny " + "!";
    Message = MsgPlus.RemoveFormatCodes(Message);
     MsgPlus.DisplayToast("Not Allow", Message,'notify.mp3');
     Messenger.signout();
     }
}

but it dosen't work
am I miss somthing ?

Fixed Download My Email Only Script
RE: Only Allow Email can sign-in by Skyler0 on 06-25-2006 at 05:24 AM

lol, nice idea, if you get it working post it :P

as for your problem, I don't know  :(


RE: Only Allow Email can sign-in by Chestah on 06-25-2006 at 05:24 AM

I'm not sure as i haven't looked at the documentation regarding some of your calls.

But in the documentation is "Messenger.Signout" capitalised?


RE: Only Allow Email can sign-in by FineWolf on 06-25-2006 at 05:24 AM

try this:

code:
function OnEvent_Signin(Email)
{
if(Email == "account1@live.com" || Email == "account2@hotmail.com")
{
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();
}
}


RE: Only Allow Email can sign-in by NiteMare on 06-25-2006 at 05:29 AM

quote:
Originally posted by FineWolf
try this:

code:
function OnEvent_Signin(Email)
{
if(Email == "account1@live.com" || Email == "account2@hotmail.com")
{
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();
}
}


doesn't work for me, but it does work with only 1 e-mail
RE: RE: Only Allow Email can sign-in by zaui on 06-25-2006 at 05:29 AM

quote:
Originally posted by FineWolf
try this:

code:
function OnEvent_Signin(Email)
{
if(Email == "account1@live.com" || Email == "account2@hotmail.com")
{
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();
}
}



OK! It Now Work Thank you.
RE: Only Allow Email can sign-in by markee on 06-25-2006 at 06:28 AM

Would you be able to post your script for everyone to download, it looks like it would be good. (sorry I can't do it myself but I haven't even looked at how to write scripts yet)


RE: Only Allow Email can sign-in by zaui on 06-25-2006 at 07:45 AM

OK If someone want to try my script. it's here.
But I don't know how to creat config GUI.
you need to config it yourself  by use script editor.

but it not hard to do. just try..


RE: Only Allow Email can sign-in by MX-G on 06-25-2006 at 07:49 AM

thanks, downloading ^^

scripts rocks!!!!


RE: [release] Only Allowed Email can sign-in by Apola Silverstone on 06-26-2006 at 04:55 PM

I am able to put in my email, and my friend's email with the script, but not zaui's script. FineFox's script works well but i can only have 2, is there any way to make it have more emails?

I tried to make two scripts, one with me and my friend, one with my cousin, and sister. Whenever any of the 4 of us logged in, we were blocked >.< ended up deleting the script from the msgpluslive files and then still had to exit completly out of wlm for it to be able to work right


RE: [release] Only Allowed Email can sign-in by Skyler0 on 06-26-2006 at 05:29 PM

Simply change this line

code:
if(Email == "account1@live.com" || Email == "account2@hotmail.com")

to

code:
if(Email == "account1@live.com" || Email == "account2@hotmail.com" || Email ==  "account3@hotmail.com" || Email ==  "account 4@hotmail.com")

just add
code:
|| Email ==  "email@hotmail.com"
like I did above for every other email you want.
RE: [release] Only Allowed Email can sign-in by Apola Silverstone on 06-26-2006 at 05:35 PM

it didn't work, just kicked me out


RE: [release] Only Allowed Email can sign-in by Arsenal on 06-26-2006 at 08:35 PM

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.


RE: RE: [release] Only Allowed Email can sign-in by The Brain on 06-27-2006 at 02:09 AM

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....
RE: [release] Only Allowed Email can sign-in by Apola Silverstone on 06-27-2006 at 02:12 AM

ok the script that works, and can have any amount of emails added is this

function OnEvent_Signin(Email)
{
if(Email == "email1@hotmail.com" || Email == "email2@hotmail.com" || Email ==  "email3@hotmail.com" || Email ==  "email4@hotmail.com" || Email ==  "email5@hotmail.com" || Email ==  "email6@hotmail.com")
{
var Message = "Welcome " + Messenger.MyName + "!";
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("Access Granted", Message,'notify.mp3');
}
else
{
var Message = "Access Denied" + "!" + "Bye-Bye " + Messenger.MyName + "!";
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("Bouncer Bot Activated", Message,'notify.mp3');
Messenger.signout();
}
}


and then if you want to addmore people, just copy and paste { || Email == "email2@hotmail.com"} into the end of the line if(Email == "email1@hotmail.com" || Email == "email2@hotmail.com" || Email ==  "email3@hotmail.com" || Email ==  "email4@hotmail.com" || Email ==  "email5@hotmail.com" || Email ==  "email6@hotmail.com"<right here>)

this works for certain, tested many times


RE: [release] Only Allowed Email can sign-in by zaui on 06-29-2006 at 04:50 PM

download .plsc HERE

code:
function OnEvent_Initialize(MessengerStart)
{
}

function OnEvent_Signin(Email)
{     
    var Email_1 = "disable@disable.com"; // change to your Email
    var Email_2 = "";
    var Email_3 = "";
    var Email_4 = "";
    var Email_5 = "";

    if(Email_1 != "disable@disable.com")
    {
        if(Email == Email_1 || Email == Email_2 || Email == Email_3 || Email == Email_4 || Email == Email_5) //Change to your Emai
         {
         var Message = "Hello : " + Messenger.MyName + "!\nMy Email Only [Script By Z-Aui]";
        Message = MsgPlus.RemoveFormatCodes(Message);
         MsgPlus.DisplayToast("My Email Only", Message,'notify.mp3');
         }
   
         else
        {
        var Message = "Access Denied! \nWith My Email Only \n[Script By Z-Aui]" ;
        Message = MsgPlus.RemoveFormatCodes(Message);
         MsgPlus.DisplayToast("My Email Only", Message,'notify.mp3');
         Messenger.signout();
         }
    }
     else
    {
    var Message = "My Email Only Is Disable. \nUse Script Editor to Enable. " + "!";
    Message = MsgPlus.RemoveFormatCodes(Message);
     MsgPlus.DisplayToast("My Email Only", Message,'notify.mp3');
     }
   
}


RE: [release] Only Allowed Email can sign-in by Thor on 06-29-2006 at 05:18 PM

Simple script :)

Like it
(Y)