hmm a problem... - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: hmm a problem... (/showthread.php?tid=64429) hmm a problem... by uggi on 08-03-2006 at 05:11 PM
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.. ?? quote: RE: hmm a problem... by rob_botch on 08-04-2006 at 09:29 AM
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. RE: RE: hmm a problem... by uggi on 08-04-2006 at 10:14 AM
quote: 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.. ) RE: hmm a problem... by mlevit on 08-04-2006 at 10:21 AM
Uggi if im getting this right, you want to access a script on his computer. RE: hmm a problem... by RaceProUK on 08-04-2006 at 10:29 AM
Why are people suggesting solutions that won't help? quote:is what the guy needs. RE: hmm a problem... by uggi on 08-04-2006 at 10:45 AM
rob_botch, mlevit, RaceProUK: ( and others.. ) RE: hmm a problem... by RaceProUK on 08-04-2006 at 10:51 AM
You have read the thread yes? quote: RE: RE: hmm a problem... by uggi on 08-04-2006 at 12:22 PM
quote: 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... RE: hmm a problem... by RaceProUK on 08-04-2006 at 12:25 PM
Gah, you really don't understand this do you? How can I make it obvious? RE: RE: hmm a problem... by uggi on 08-04-2006 at 12:42 PM
quote: just forget this... you donīt understand what i want it to do... your behaviour and mood is rather than good... Forget this question... RE: hmm a problem... by mlevit on 08-04-2006 at 12:58 PM
Uggi i think i might have got it. code: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. RE: hmm a problem... by RaceProUK on 08-04-2006 at 01:49 PM
quote:You want the script to trigger on your contact's machine only. If that's wrong, then please explain why. quote:It is, but it's an ugly way to do it. The better (and documented) way is: code: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: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 quote:No RE: hmm a problem... by uggi on 08-04-2006 at 02:36 PM
RaceProUK >> RE: hmm a problem... by rob_botch on 08-04-2006 at 05:47 PM 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. |