What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » what is wrong?

Pages: (2): « First [ 1 ] 2 » Last »
what is wrong?
Author: Message:
89rafa
Junior Member
**


Posts: 16
Joined: Sep 2007
O.P. what is wrong?
function OnEvent_MyPsmChange(NewPsm)
{
SendMessage("/me changed the personal message");
}
09-01-2007 11:03 PM
Profile E-Mail PM Find Quote Report
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: what is wrong?
well it doesn't know where to send the message to...
you should use something like
code:
ChatWindow.SendMessage("/me changed the personal message");

but you have to define that ChatWindow first...
09-01-2007 11:05 PM
Profile E-Mail PM Find Quote Report
89rafa
Junior Member
**


Posts: 16
Joined: Sep 2007
O.P. RE: what is wrong?
and how we do that.. i'm noob in javascript
i never had programed =X
09-01-2007 11:08 PM
Profile E-Mail PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: what is wrong?
you haven't defined a chat window to send the message from.

This will work:

code:
function OnEvent_MyPsmChange(NewPsm)
{
var Windows = Messenger.CurrentChats;
var e = new Enumerator(Windows);
for(; !e.atEnd(); e.moveNext())
{
    var ChatWindow = e.item();
    ChatWindow.SendMessage("/me has changed their personal message");
}

}


That will send the /me message to every open conversation you have.

Hope that is what you want :)

PS: you can also make it display your new psm by including it in the /me message like this

code:
ChatWindow.SendMessage("/me has changed their personal message to " + NewPsm);

This post was edited on 09-01-2007 at 11:13 PM by Stigmata.
09-01-2007 11:10 PM
Profile PM Web Find Quote Report
89rafa
Junior Member
**


Posts: 16
Joined: Sep 2007
O.P. RE: what is wrong?
can you explain me the

var Windows = Messenger.CurrentChats;
var e = new Enumerator(Windows);
for(; !e.atEnd(); e.moveNext())
{
var ChatWindow = e.item();


i dont get it...
09-01-2007 11:14 PM
Profile E-Mail PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: what is wrong?
code:
    var Windows = Messenger.CurrentChats;

The Messenger.CurrentChats is a list of chat windows already open.

code:
    var e = new Enumerator(Windows);

Here we enumerate the list so we can sort the chat windows individually.

code:
    for(; !e.atEnd(); e.moveNext())
    {

This is a start of a "for loop". Using the enumeration we did in the line before we go through each chat window object.

Here is some more information on loops in javascript:
http://www.w3schools.com/js/js_loop_for.asp

code:
    var ChatWindow = e.item();

Here we define the current enumerated chat window as ChatWindow so it is easier to handle :)

This post was edited on 09-01-2007 at 11:22 PM by Stigmata.
09-01-2007 11:21 PM
Profile PM Web Find Quote Report
89rafa
Junior Member
**


Posts: 16
Joined: Sep 2007
O.P. RE: what is wrong?
i think i get it now,
but i would never obtain that.

I want to learn .js :'(
09-01-2007 11:28 PM
Profile E-Mail PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: what is wrong?
Here is a good place to start :)

http://www.w3schools.com/js/default.asp
09-01-2007 11:35 PM
Profile PM Web Find Quote Report
89rafa
Junior Member
**


Posts: 16
Joined: Sep 2007
O.P. RE: what is wrong?
i already had that link. .  but my english is kind of poor... but i'll try
09-01-2007 11:36 PM
Profile E-Mail PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: what is wrong?
Well which language do you speak?
09-01-2007 11:37 PM
Profile PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« 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