Two questions: !remotecommand and Messenger.MyContacts - 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: Two questions: !remotecommand and Messenger.MyContacts (/showthread.php?tid=79940) Two questions: !remotecommand and Messenger.MyContacts by kaourika on 12-11-2007 at 08:05 PM
I don't know JS at all, so as a learning experience I just started throwing things together, and naturally I've run into some questions. code:... there was a lot more in here; I'm just including the relevent stuff... code: Any tips on doing what I need to do? Second question I can't understand Messenger.MyContacts. For example, here, code:MyName works fine, but Contacts just produces a blank space. I read in the documentation that this could happen due to the contact being logged out, but that wasn't the case here. Thanks for any help RE: Two questions: !remotecommand and Messenger.MyContacts by markee on 12-12-2007 at 09:01 AM
for your first question, you should use the function OnEvent_ChatWndReceivedMessage(ChatWnd,Origin,Msg,Kind){ code:to return their display name (which i think is what you want). RE: Two questions: !remotecommand and Messenger.MyContacts by kaourika on 12-13-2007 at 12:31 AM
Thanks for the help, Markee. =) code:There were more !commands, but I temporarily removed them so they wouldn't complicate my diagnosis. Anyway, I can't seem to find the problem with it =/ The display name was indeed what I was after. However, with that code, won't it only work with one person, the person whose email I define? If it's possible and not too horribly complex, I was trying to make the script adapt to whoever I was talking to at the time. RE: Two questions: !remotecommand and Messenger.MyContacts by ddunk on 12-13-2007 at 12:40 AM
There's a couple problems. code:So "Message" is undefined. So either change "Message" to "Msg" or "Msg" to "Message" and that part of the code should be just fine. RE: Two questions: !remotecommand and Messenger.MyContacts by kaourika on 12-13-2007 at 01:19 AM
Ah! Thank you!! Now the script is actually attempting a return instead of just displaying the raw !command. I'm glad I don't have to go searching other chunks of the code for the problem. code:But now it attempts to shave the response to 8 characters, I guess because of "(Message.substr(0,8)"... This is the return I'm getting in the conversation window (My name right now being Kao): quote: It didn't have that problem when I was using "function OnEvent_ChatWndSendMessage." The Message.substr(0,8) is just supposed to apply to the raw !command, not the return, so that's weird... Also, for my contact, when they say !petrafi, it executes the script in my view of the conversation, but in theirs, it still just says !petrafi. I hope there's a way around that! =/ Thanks for the continuing help! :3 RE: Two questions: !remotecommand and Messenger.MyContacts by pollolibredegrasa on 12-13-2007 at 01:29 AM I think the problem is that the message you return in the ChatWndReceiveMessage event cannot be longer than the original message, or it just gets truncated. There's no way round this to my knowledge I'm afraid, as it's a technical limitation of Plus. RE: Two questions: !remotecommand and Messenger.MyContacts by kaourika on 12-13-2007 at 01:44 AM
...Crap. RE: Two questions: !remotecommand and Messenger.MyContacts by ShawnZ on 12-13-2007 at 01:46 AM
quote: when you return from "chatwndreceivemessage", you're editing their text as it appears to you, not sending another message back to them. RE: Two questions: !remotecommand and Messenger.MyContacts by kaourika on 12-13-2007 at 01:55 AM
Ah! Okay, I understand, thank you. RE: Two questions: !remotecommand and Messenger.MyContacts by ShawnZ on 12-13-2007 at 02:31 AM
quote: yes, whatever you return from "chatwndsendmessage" will change the message being sent, and whatever you return from "chatwndreceivemessage" will change the message being received. what you want to do is send a new message altogether from within "chatwndreceivemessage", not return anything. RE: Two questions: !remotecommand and Messenger.MyContacts by kaourika on 12-13-2007 at 03:53 AM
Alright! I figured out how to do that, and almost everything is working perfectly now! Thanks! RE: Two questions: !remotecommand and Messenger.MyContacts by markee on 12-13-2007 at 11:12 PM use the Origin variable that is a parameter of the function. RE: Two questions: !remotecommand and Messenger.MyContacts by CookieRevised on 12-13-2007 at 11:41 PM
PS: reading the scripting documents helps a lot in such cases. Most problems you encountered here are explained very clearly in the scripting documentation. quote:Which covers your first problems you had. eg: Scripting Doc > Index > OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) quote:Which covers all the other problems you had with ChatWndReceiveMessage. Note: there are other VERY important notes about this event function. I'm not going to quote them all though, see the help files for that. eg: Scripting Doc > Index > ChatWnd.SendMessage quote:Important: quote: eg: Scripting Doc > Index > ChatWnd.EditChangeAllowed quote: eg: Scripting Doc > Index > Messenger.MyName quote: etc... The scripting documentation can be found on the official homepage of Messenger Plus!, here: http://www.msgpluslive.net/scripts/view/13-Offici...ing-Documentation/ Or by selecting "Script Documentation" in the Options menu in the Script Editor. have fun scripting... but remember, read the docs first, then experiment with trial and error... |