What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Won't display toasts

Won't display toasts
Author: Message:
Addenorw
New Member
*


Posts: 5
Joined: Nov 2007
O.P. Won't display toasts
MSN won't display my toasts in my script.

code:
function OnEvent_Initialize(MessengerStart)
{
      Debug.Trace("Hello World!");
}

function OnEvent_Signin(Email)
{
if (email == "andvibeto@msn.com")
{
   var Message = "Hello Master " + Messenger.MyName + "!";
   Message = MsgPlus.RemoveFormatCodes(Message);
   MsgPlus.DisplayToast("", Message);

}

function OnEvent_ContactSignin(Email)
{
var Message = "Latest INTEL:" + Messenger.ContactName + "has just signed in";
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToastContact("", CtcName, message);
}

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind)
{
var Message = Messenger.ContactName + "vil snakke, plage deg eller bare si hallo. Your choice";
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("", CtcName, message);
}

function OnEvent_Signout(Email)
{
if (email == "andvibeto@msn.com")
{ var Message = "Until next time Master" + Messenger.MyName + ", have a good time!";
   Message = MsgPlus.RemoveFormatCodes(Message);
   MsgPlus.DisplayToast("", Message);
}
}

function OnEvent_Uninitialize(MessengerExit)
{
     Debug.Trace ("Goodbye World!");
}


Do anyone see what is wrong?
10-06-2008 05:08 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: Won't display toasts
Yes, you're not getting the variable CtcName from anywhere... You need to iterate through a contact object (from using the email and GetContact function) to get a name
<Eljay> "Problems encountered: shit blew up" :zippy:
10-06-2008 05:22 PM
Profile PM Find Quote Report
Addenorw
New Member
*


Posts: 5
Joined: Nov 2007
O.P. RE: Won't display toasts
What function should I use then? My intention with that one was to show the original "x has just signed in". Email won't be right, because then I would be having to write an email for everybody i want it to show for, or?

Edit: It won't show any toasts at all. Some of the toast was showen before I added some more

This post was edited on 10-06-2008 at 05:29 PM by Addenorw.
10-06-2008 05:27 PM
Profile E-Mail PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
RE: Won't display toasts
to iterate through a Contacts object, first you must start a for statement:
code:
for(
then, add the enumerator object as a variable (and the parameters as the Contacts object):
code:
var e = new Enumerator(ChatWnd.Contacts);
loop through the enumeration while it isn't at the end:
code:
!e.atEnd; e.moveNext()
end the for statement and add braces.
code:
){
// some code here (occurs for each item)..
}

then get the Contact Object items by using
code:
e.item();
.

:P


but then also, since you're doing that in the ChatWndReceiveMessage, it has an Origin parameter which has the contact's (or your) name in it (depending on who just sent a message)

This post was edited on 10-06-2008 at 09:32 PM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
10-06-2008 07:54 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Won't display toasts
quote:
Originally posted by Addenorw
Messenger.ContactName
And this doesn't exist

You need to use

code:
var sName = Messenger.Contacts.GetContact(Email).Name;

This post was edited on 10-06-2008 at 08:20 PM by matty.
10-06-2008 08:20 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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