What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » hmm a problem...

Pages: (2): « First « 1 [ 2 ] Last »
hmm a problem...
Author: Message:
mlevit
Junior Member
**


Posts: 50
Reputation: 2
37 / Male / –
Joined: Sep 2005
RE: hmm a problem...
Uggi i think i might have got it.
code:
var sendingMessage = "";

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
    sendingMessage = Message;
    return Message;
}

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
    if (Message == sendingMessage)
    {
        //Do nothing
    }
    else
    {
        //Your code here
    }
}
Im not sure but i think this is what you're trying to achive?

What this will do, is check if the message received in the chat window didn't come from you. Obviously if it did, then !popup would't work else if its from someone else it would.

I do think that RaceProUK is right too, you check the Origin of the message against your name, if its from you dont do anything else do stuff.

Not sure, this is what we are getting from your posts.

This post was edited on 08-04-2006 at 01:02 PM by mlevit.
08-04-2006 12:58 PM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: hmm a problem...
quote:
Originally posted by uggi
you donīt understand what i want it to do
You want the script to trigger on your contact's machine only. If that's wrong, then please explain why.
quote:
Originally posted by mlevit
Uggi i think i might have got it.
code:
var sendingMessage = "";

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
    sendingMessage = Message;
    return Message;
}

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
    if (Message == sendingMessage)
    {
        //Do nothing
    }
    else
    {
        //Your code here
    }
}
Im not sure but i think this is what you're trying to achive?
It is, but it's an ugly way to do it. The better (and documented) way is:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
    if (Origin != Messenger.MyName) // Rejects your own messages
    {
        // Do stuff here
    }
}
This code block will only respond to the command if it was sent by someone other than yourself. This test is suggested in the Plus! documentation (and quoted several times above), and given you always compare the Origin to your current display name, it should be practically faultless.
I've also taken the liberty of simplifying the if{} construct to remove the unnecessary else {} clause.

There's only one thing that will bring this solution down: if your contact has the same display name as you. Which, let's face it, is very rare.
quote:
Originally posted by uggi
your behaviour and mood is rather than good
I just get frustrated when I'm making things clear, yet people don't get it. Well, I've now posted a full code sample, so hopefully it's irrevocably clear now [Image: msn_wink.gif]
quote:
Originally posted by uggi
Forget this question
No :P
[Image: spartaafk.png]
08-04-2006 01:49 PM
Profile PM Web Find Quote Report
uggi
New Member
*


Posts: 11
37 / Male / –
Joined: Jul 2006
O.P. RE: hmm a problem...
RaceProUK >>

You are a very strange but wise person.. ;) why did you DONīT say all this at the FIRST post... *GG*

i'm confused over how uncomplicated this piece of code is... thanks A LOT...

08-04-2006 02:36 PM
Profile E-Mail PM Web Find Quote Report
rob_botch
Full Member
***

Avatar

Posts: 180
Reputation: 4
34 / Male / Flag
Joined: Apr 2006
RE: hmm a problem...
Actually, if you look on the very first reply (mine) and RaceProUK's first post, they both make clear the solution, just not in the explicit code.
08-04-2006 05:47 PM
Profile E-Mail 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