Shoutbox

[Q] Clickable Toast - 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: [Q] Clickable Toast (/showthread.php?tid=69412)

[Q] Clickable Toast by PaulE on 12-12-2006 at 05:53 PM

Hi Guys, ;)

How can you make a Clickable Toast?
I got the command:

code:
function OnEvent_ContactSignin(email)
{
    if(email == 'foo@live.com') {
    }
}

I want that when foo@live.com is comming online, there comes a toast, and when i click on it, it starts a conversation..

I want this because when i'm gaming, my status is going be busy, and then i cant see who comes online (who i want to talk to).. :P

Thnx,
PaulE
RE: [Q] Clickable Toast by Matti on 12-12-2006 at 05:57 PM

No problem!

code:
function OnEvent_ContactSignin(email)
{
if(email == 'foo@live.com') {
MsgPlus.DisplayToastContact("Notification", email, "came online.", "", "ToastCallback");
}
}

function ToastCallback(){
Messenger.OpenChat("foo@live.com");
}

RE: [Q] Clickable Toast by Spunky on 12-12-2006 at 06:00 PM

code:
var Contact

function OnEvent_ContactSignin(email)
{
if(email == 'foo@live.com') {
Contact = email
MsgPlus.DisplayToast("Title","Message","soundfile","callback function");
}
}

function callback(){
Messenger.OpenChat(Contact);
}


That should do it. If not, you could always look stuff up in the Scripting Documentation

EDIT: Beaten
RE: [Q] Clickable Toast by PaulE on 12-12-2006 at 06:01 PM

And what i have to do when i want more then 1 email? :P


RE: [Q] Clickable Toast by Spunky on 12-12-2006 at 06:02 PM

TIP: You could make an array of emails and use a loop to compare each one to the user that has just signed and if it finds a match, display the toast. That way you just add users to the array to add them to the list so to speak


RE: [Q] Clickable Toast by PaulE on 12-12-2006 at 06:07 PM

Hehe, thnx, problem solved :D


RE: [Q] Clickable Toast by Matti on 12-12-2006 at 06:11 PM

quote:
Originally posted by PaulE
And what i have to do when i want more then 1 email? :P
code:
//Add as much contacts as you want here, but not too much since looping can slow down your Messenger
var checkFor = new Array("someone@live.com", "somebody@live.com");

function OnEvent_ContactSignin(email) {
   for(i in checkFor) {
      if(email == checkFor[i]) {
         //Now it even shows the name in the popup! :-D
         MsgPlus.DisplayToastContact("Notification", Messenger.MyContacts.GetContact(email).Name, "came online.", "", "ToastCallback", email);
         return;
   }
}

//Now accepts an email parameter to make things easier ;-)
function ToastCallback(email){
   Messenger.OpenChat(email);
}
Damn, you already got it. :P Ah well, maybe this could be interesting for someone. :)
RE: [Q] Clickable Toast by PaulE on 12-12-2006 at 06:14 PM

haha, thnx much more nicer! :D

--

haha, bedankt stukken mooier! :D