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:
general sirhc
New Member
*


Posts: 11
Joined: Oct 2007
O.P. smarterchild reply (simple for most people)
I've just started making my second script ever and i'm still learning the ropes about how do things anyway so far i have got

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind){
if (Origin !== Messenger.MyName)
if (Origin !== '- SmarterChild - *unicef contributing to charity'){
Messenger.OpenChat('smarterchild@hotmail.com')
  Contacts = new Enumerator(ChatWnd.Contacts);
  Contacts.moveFirst;
  Contact = Contacts.item();
  Messenger.OpenChat(Contact.Email);
}
}

i'm trying to make it that when some1 sends you a message then you send the message to smarter child then when smarter child replys you send the reply to the person how sent you the message. any other help with scripting and i'll be thankful

SOMEONE PLEASE HELP!

This post was edited on 10-14-2007 at 06:09 AM by general sirhc.
10-14-2007 03:46 AM
Profile E-Mail PM Find Quote Report
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
vaccination
Veteran Member
*****

Avatar

Posts: 2513
Reputation: 43
32 / Male / –
Joined: Apr 2005
RE: smarterchild reply (simple for most people)
I can only think of the implications. For example, most of the replies will have smarterchild spam like "Press 1 to.." and "Have you heard about..." Not only that but what if your contact asks a question related to you, personal question etc, smarterchild won't know the answer and will reply with something stupid. etc etc.




As for telling which reply goes with which message; time based? which ever question is sent fisrt, the first reply will be sent to them, second reply to second person etc. Though, there's still implications...
[Image: jumbled.png]
10-14-2007 09:27 AM
Profile PM Find Quote Report
general sirhc
New Member
*


Posts: 11
Joined: Oct 2007
O.P. RE: smarterchild reply (simple for most people)
i dont want smarter child to talk as me i just want it so its like a mocker (kinda like one of the old simple mockers that repeated what the person says back at them)

EDIT: win_crook thanx for the help but your code stuffed up with the
code:
  if (Origin == sc.Name)
  {
    break;
  }
  if(MessageKind == 1)
so i had to change it to
code:
var window = Messenger.OpenChat('smarterchild@hotmail.com');
window.SendMessage(Message);
which works ok but it keeps sending the message ( i think it was a glitch with msg plus not the code)
anyway thanks for the help and anymore you can offer

This post was edited on 10-14-2007 at 02:49 PM by general sirhc.
10-14-2007 02:12 PM
Profile E-Mail PM Find Quote Report
« 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