Shoutbox

broken example script - 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: broken example script (/showthread.php?tid=63943)

broken example script by jvlppm on 07-25-2006 at 01:42 AM

quote:
function OnEvent_Signin(Email)
{
    var Message = "Hello Master " + Messenger.MyName + "!";
    Message = MsgPlus.RemoveFormatCodes(Message);
    MsgPlus.DisplayToast("", Message);
}

Now, you may think "hey, I'm the only master on this computer, I don't want the script to welcome others in this way".


this script does only works when i sign in, this function is not called when others came online


my function

function OnEvent_Signin(Email)
{
    Debug.Trace(Email + " entrou!");
    MsgPlus.DisplayToast("", Email + " entrou!");
}


i have nothing on debug when ppl sign in, only when i do

yes the script is activated
RE: broken example script by cooldude_i06 on 07-25-2006 at 01:44 AM

That is the way it is supposed to work. If you want to find out when a contact signs in use this event:

code:
OnEvent_ContactSignin(
    [string] Email
);


RE: broken example script by cloudhunter on 07-25-2006 at 01:46 AM

Well that is what the function is for... when you sign in. When other people sign in the function is:

quote:
Originally posted by Messenger Plus! live Scripting Documentation

OnEvent_ContactSignin(
    [string] Email
);


To get it to do what you want, you would use this code:

code:
function OnEvent_ContactSignin(Email)
{
Debug.Trace(Email + " entrou!");
MsgPlus.DisplayToast("", Email + " entrou!");
}

Cloudy

Edit: Why do I always get beaten to a reply :(
RE: broken example script by jvlppm on 07-25-2006 at 01:49 AM

i see, but is not what the scripting documentation says...

if you read, it says that the function on the example works for everybody

and it shows a way to workarround it!

quote:
so let's change the OnEvent_Signin function to this:

function OnEvent_Signin(Email)
{
    if(Email == "your@email.com") //Change for your sign-in email
    {
        var Message = "Hello Master " + Messenger.MyName + "!";
        Message = MsgPlus.RemoveFormatCodes(Message);
        MsgPlus.DisplayToast("", Message);
    }
}


RE: broken example script by cloudhunter on 07-25-2006 at 01:56 AM

When it says the function works for everybody, it means everybody that uses your messenger... It doesn't mean everyone that signs in while you are logged in. Use the code I showed you, it SHOULD work.

Cloudy


RE: RE: broken example script by jvlppm on 07-25-2006 at 01:57 AM

quote:
Originally posted by cloudhunter
When it says the function works for everybody, it means everybody that uses your messenger... It doesn't mean everyone that signs in while you are logged in.
Cloudy


a ok
RE: broken example script by matty on 07-25-2006 at 02:25 AM

Did you read the scripting documentation?

[Image: attachment.php?pid=701912]


RE: broken example script by jvlppm on 07-25-2006 at 03:12 AM

reading in sequence, i did not reach that page when i posted here