What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Two questions: !remotecommand and Messenger.MyContacts

Pages: (2): « First « 1 [ 2 ] Last »
Two questions: !remotecommand and Messenger.MyContacts
Author: Message:
kaourika
Junior Member
**


Posts: 16
Reputation: 1
34 / Female / –
Joined: Jul 2006
O.P. RE: Two questions: !remotecommand and Messenger.MyContacts
Alright! I figured out how to do that, and almost everything is working perfectly now! :D Thanks!

Just one little annoyance... in my variable responses, I put Messenger.Myname, which I thought would return the name of the person who invoked the !command. Instead, it always returns MY name, even when it's my friends who typed !commandwhatever.

So, is there any way to produce the name of the person who initiated the command?

Thanks! 8D

This post was edited on 12-13-2007 at 04:25 AM by kaourika.
12-13-2007 03:53 AM
Profile E-Mail PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: Two questions: !remotecommand and Messenger.MyContacts
use the Origin variable that is a parameter of the function.
[Image: markee.png]
12-13-2007 11:12 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Two questions: !remotecommand and Messenger.MyContacts
PS: reading the scripting documents helps a lot in such cases. Most problems you encountered here are explained very clearly in the scripting documentation.

So, major tip: each time you want to use a certain function, look up that function in the scripting documentation and read its explaination.




eg: Scripting Doc > Index > OnEvent_ChatWndSendMessage
quote:
Return Value
A string containing the message to be sent (thus not recieved) instead (thus it will be replaced) of Message. If you do not want to modify the message, simply return Message without changing it. No size restriction applies to the new message except for the maximum size allowed by Messenger. If the event handler returns an empty string, the message is ignored and not sent to the server.
Which covers your first problems you had.



eg: Scripting Doc > Index > OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
quote:
Origin
Name of the user that sent the message (which covers one of your other questions in how to get the contact's name), as it appears in the chat window.......

Return Value
A string containing the message to be displayed in the chat window instead of Message (which explains why you didn't saw what the contact had typed, but you saw your new string, at least a part of it). If you do not want to modify the message, simply return Message without changing it. The new string will be parsed for possible format codes. It is important to remember that the new message cannot be longer than the original one (use Message.length) and will be cut if necessary which explains why the string was truncated. Also, Messenger will not re-parse the message for emoticons codes.
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:
The ChatWnd.SendMessage function sends a (new) message to the contacts currently present in the chat window.
Important:
quote:
The EditChangeAllowed property should be checked before this function is called.



eg: Scripting Doc > Index > ChatWnd.EditChangeAllowed
quote:
The ChatWnd.EditChangeAllowed property specifies whether or not text can be entered/send in the typing area of the chat window.



eg: Scripting Doc > Index > Messenger.MyName
quote:
A string containing the name of the current user (thus not a contact; the user is you... hence MyName).




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...

;)

This post was edited on 12-13-2007 at 11:47 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-13-2007 11:41 PM
Profile PM 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