hmm a problem... |
Author: |
Message: |
uggi
New Member
Posts: 11
37 / / –
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 |
|
|
rob_botch
Full Member
Posts: 180 Reputation: 4
34 / /
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 |
|
|
uggi
New Member
Posts: 11
37 / / –
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 |
|
|
mlevit
Junior Member
Posts: 50 Reputation: 2
37 / / –
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 |
|
|
RaceProUK
Elite Member
Posts: 6073 Reputation: 57
39 / /
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.
|
|
08-04-2006 10:29 AM |
|
|
uggi
New Member
Posts: 11
37 / / –
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 |
|
|
RaceProUK
Elite Member
Posts: 6073 Reputation: 57
39 / /
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.
|
|
08-04-2006 10:51 AM |
|
|
uggi
New Member
Posts: 11
37 / / –
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 |
|
|
RaceProUK
Elite Member
Posts: 6073 Reputation: 57
39 / /
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.
|
|
08-04-2006 12:25 PM |
|
|
uggi
New Member
Posts: 11
37 / / –
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...
your behaviour and mood is rather than good...
Forget this question...
|
|
08-04-2006 12:42 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|