What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » smarterchild reply (simple for most people)

smarterchild reply (simple for most people)
Author: Message:
win_crook
Junior Member
**


Posts: 63
Reputation: 2
31 / Male / Flag
Joined: Apr 2007
RE: smarterchild reply (simple for most people)
This isn't actually that simple;
What about when there is multiple conversations? You would need some way of working out which conversation to send the correct smarterchild response back to.

I'll help with the receiving a message and then sending it to smarterchild part. But you or someone else will have to think of a way to code the sending the replys back part.

I'll write some code and an explanation for it, and put it in this post when I'm done ;)

EDIT:

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
  var Contacts = Messenger.MyContacts;
  var sc = Contacts.GetContact('smarterchild@hotmail.com');
  if (Origin == sc.Name)
  {
    break;
  }
  if(MessageKind == 1)
  {
      var window = Messenger.OpenChat('smarterchild@hotmail.com');
      window.SendMessage(Message);
    }
  }
}


Okay and now for the explanation:
code:
  var Contacts = Messenger.MyContacts;
  var sc = Contacts.GetContact('smarterchild@hotmail.com');
  if (Origin == sc.Name)
  {
    break;
  }

1)We get the contact list using Messenger.MyContacts and store it in a variable called Contacts
2)Then we find smarterchild in this list and store it in sc
3)The if statement gets smarterchilds name from the sc we stored earlier and checks that the message wasn't from smarterchild. If it is we use break, which ends the currently running function. Therefore no more code is run and the message isn't sent.

code:
  if(MessageKind == 1)
  {
      var window = Messenger.OpenChat('smarterchild@hotmail.com');
      window.SendMessage(Message);
   }


1) MessageKind equals 1 when the message that has been recieved is text. Others can be winks, voice clips, searches etc... We won't be able to send those onto smarterchild so we simply ignore them by only accepting text messages by making sure MessageKind is 1.
2)We open a window with smarterchild and store it in window. If there is already a conversation open with smarterchild then the already open one is stored in window
3)Then we simply use window to send the message that we recieved.

This post was edited on 10-14-2007 at 09:47 AM by win_crook.
10-14-2007 09:08 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
smarterchild reply (simple for most people) - by general sirhc on 10-14-2007 at 03:46 AM
RE: smarterchild reply (simple for most people) - by win_crook on 10-14-2007 at 09:08 AM
RE: smarterchild reply (simple for most people) - by vaccination on 10-14-2007 at 09:27 AM
RE: smarterchild reply (simple for most people) - by general sirhc on 10-14-2007 at 02:12 PM


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