Simple Problem w/ Objects - 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: Simple Problem w/ Objects (/showthread.php?tid=92219) Simple Problem w/ Objects by Cetanu on 09-15-2009 at 02:34 PM
I am looking to use SendMessage if someone messages me when I am Busy or Away, but I don't know how to create an object of ChatWnd. Could someone please explain what it means (and how to) to create an object of ChatWnd. RE: Simple Problem w/ Objects by matty on 09-15-2009 at 02:45 PM Have a look at this thread for some useful information. Script Always Stopped RE: Simple Problem w/ Objects by Cetanu on 09-15-2009 at 02:50 PM That's great! THANKS A LOT! RE: Simple Problem w/ Objects by matty on 09-15-2009 at 02:58 PM No problem, glad it cleared up the confusion for you RE: Simple Problem w/ Objects by Cetanu on 09-15-2009 at 05:18 PM
There is one more thing I forgot: RE: Simple Problem w/ Objects by matty on 09-15-2009 at 05:45 PM
The function OnEvent_ChatWndMessageReceive has a parameter called pChatWnd. This is the Chat Window where the event happened. Therefore you could do something like this: js code: RE: Simple Problem w/ Objects by Cetanu on 09-15-2009 at 06:02 PM
Has anyone referred to you as a deity? RE: Simple Problem w/ Objects by matty on 09-15-2009 at 06:36 PM No problem it is what we are here for. There have been a lot of discussion surrounding the best way to programmatically tell who sent what message through Plus! Scripting. The sad thing is is that Plus! has no way of knowing the email of the contact; only their name. With that said this is the easiest way of knowing if you sent the message. If the messages do not match well than you know you didn't send it. RE: Simple Problem w/ Objects by Cetanu on 09-15-2009 at 08:32 PM Well, thanks. I've used this code so much already....XD RE: Simple Problem w/ Objects by CookieRevised on 11-23-2009 at 09:47 PM
quote:Unfortunatly, I see you use that kind of approach in many example codes of yours. Although it would work in theory, it is not implemented properly in any of your example codes and thus will not work properly! You will get into trouble when the contact sends the same message (at a certain point in time) as you last did: You: Type the next command to initiate the transfer: You: !start Contact: Ah, ok, thanks. I'l send the command now Contact: !start Contact: nothing happened You: Hmm, the code in OnEvent_ChatWndReceiveMessage was never executed... ... ^^ the above scenario will show exactly what I mean... To solve that you must delete oChatWnds[pChatWnd.Handle] before you return with sMessage in OnEvent_ChatWndReceiveMessage js code: |