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:
uggi
New Member
*


Posts: 11
37 / Male / –
Joined: Jul 2006
O.P. hmm a problem...
when i use the OnEvent_ChatWndReceiveMessage function to send a command to my script, fx. "!popup" it runs the code as normal, but if i send the script to a friend and he runs it and write the same command in a chat window to me, then my script run on both computers.. how can i stop that.. ??

some of my code:

quote:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
    if(MessageKind == 1)
    {
if(Message.substr(0,7) == '!popup ') {
    var naam = Origin.substr(0,16);
    if(Message.substr(7) == '') {
        var Text = "You need to post a message after !popup..";
        ChatWnd.SendMessage(Text);
    } else {
        var Text = Message.substr(7);
        ext = MsgPlus.RemoveFormatCodes(Text);
        MsgPlus.DisplayToast("",Text);
    }
}
    }
}
08-03-2006 05:11 PM
Profile E-Mail PM Web Find Quote Report
rob_botch
Full Member
***

Avatar

Posts: 180
Reputation: 4
33 / Male / Flag
Joined: Apr 2006
RE: hmm a problem...
The ChatWndReceiveMessage event is triggered when any message appears in the chat window. This includes messages that you yourself send. If you are trying to get the popup to appear on your contact's side, then you need to filter out messages from you. You can do this by either checking the Origin against your nickname, or by enumerating the contacts in the chat. Unfortunately, neither method is 100% accurate, because Plus! only receives the nickname of the sender, not the email address or UID.

If you want the popup to only show on your side, change the event to ChatWndSendMessage.

I hope this helps

Robert
08-04-2006 09:29 AM
Profile E-Mail PM Web Find Quote Report
uggi
New Member
*


Posts: 11
37 / Male / –
Joined: Jul 2006
O.P. RE: RE: hmm a problem...
quote:
Originally posted by rob_botch
The ChatWndReceiveMessage event is triggered when any message appears in the chat window. This includes messages that you yourself send. If you are trying to get the popup to appear on your contact's side, then you need to filter out messages from you. You can do this by either checking the Origin against your nickname, or by enumerating the contacts in the chat. Unfortunately, neither method is 100% accurate, because Plus! only receives the nickname of the sender, not the email address or UID.

If you want the popup to only show on your side, change the event to ChatWndSendMessage.

I hope this helps

Robert


Thanks, but if i want to use my friends script, on the pc that he is using, i need to send the command in ChatWndReceiveMessage right ?

Or can i make it so then i send a command to him, the only script that response to the command is on that pc and not on my own pc...

( sry for the language.. )
08-04-2006 10:14 AM
Profile E-Mail PM Web Find Quote Report
mlevit
Junior Member
**


Posts: 50
Reputation: 2
37 / Male / –
Joined: Sep 2005
RE: hmm a problem...
Uggi if im getting this right, you want to access a script on his computer.

What you can do, is create another command to activate the script in ChatWndReceiveMessage.

You use !popup for your computer, and say !!popup for his computer.
08-04-2006 10:21 AM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: hmm a problem...
Why are people suggesting solutions that won't help?
quote:
Originally posted by rob_botch
You can do this by either checking the Origin against your nickname
is what the guy needs.
[Image: spartaafk.png]
08-04-2006 10:29 AM
Profile PM Web Find Quote Report
uggi
New Member
*


Posts: 11
37 / Male / –
Joined: Jul 2006
O.P. RE: hmm a problem...
rob_botch, mlevit, RaceProUK: ( and others.. )

If you look in my script, i only have one command, the "!popup", i use it to let my contacts write a message in a popup to me...

Now, i sent it to my friend, so it runs on both computers, if he write "!popup hello" to me, i see a popup on my screen, AND he see it on the screen he use.

The only problem is that i donīt want the script to show the popup on the computer the command is used on, but only the other computer.

Is there a function/event/anything to do that or not ?

and btw RaceProUK:

negativity is maybe also a problem huh...
08-04-2006 10:45 AM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: hmm a problem...
You have read the thread yes?
quote:
Originally posted by RaceProUK
quote:
Originally posted by rob_botch
You can do this by either checking the Origin against your nickname
is what the guy needs.

This post was edited on 08-04-2006 at 10:51 AM by RaceProUK.
[Image: spartaafk.png]
08-04-2006 10:51 AM
Profile PM Web Find Quote Report
uggi
New Member
*


Posts: 11
37 / Male / –
Joined: Jul 2006
O.P. RE: RE: hmm a problem...
quote:
Originally posted by RaceProUK
You have read the thread yes?
quote:
Originally posted by RaceProUK
quote:
Originally posted by rob_botch
You can do this by either checking the Origin against your nickname
is what the guy needs.


Yes, i have read your tread, BUT this is not the way to do it, because i change my nickname 2 times a day..and... i'm not the only one that use the script...
08-04-2006 12:22 PM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: hmm a problem...
Gah, you really don't understand this do you? How can I make it obvious?
I know: Messenger.MyName.

And before you have a go at me for acting like this, it's only because you're causing me frustration since you seem unable to grasp the very simple concept I'm trying to get across.

In fact, sod it, I'll make it plain and simple.

if (Origin != Messenger.MyName) {
    // Do shit
}

This post was edited on 08-04-2006 at 12:27 PM by RaceProUK.
[Image: spartaafk.png]
08-04-2006 12:25 PM
Profile PM Web Find Quote Report
uggi
New Member
*


Posts: 11
37 / Male / –
Joined: Jul 2006
O.P. RE: RE: hmm a problem...
quote:
Originally posted by RaceProUK
Gah, you really don't understand this do you? How can I make it obvious?
I know: Messenger.MyName.

And before you have a go at me for acting like this, it's only because you're causing me frustration since you seem unable to grasp the very simple concept I'm trying to get across.

In fact, sod it, I'll make it plain and simple.

if (Origin != Messenger.MyName) {
    // Do shit
}


just forget this... you donīt understand what i want it to do... (N)

your behaviour and mood is rather than good...

Forget this question...
08-04-2006 12:42 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