Shoutbox

auto responding - 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: auto responding (/showthread.php?tid=87933)

auto responding by jollyscripts on 12-23-2008 at 07:04 PM

the first thing is:


function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind){
if(Origin != Messenger.MyName){
var newChatWnd = Messenger.OpenChat("someone@someone.com");
newChatWnd.SendMessage(Message);
}
}

------------

how would i make it so if i recieved an message from one person then i sends it
to another email address because at the moment its just sending everybodys message to another e-mail address.




2nd thing



how would you make a script
that

1) if ( message  = hi and email address =  " " ) then
     send message ( " hello" )


RE: auto responding by roflmao456 on 12-23-2008 at 07:14 PM

1: You have to iterate (or loop though) the whole contact list and match each contact's name with Origin.

JScript code:
for ( e = new Enumerator(Messenger.MyContacts);!e.atEnd();e.moveNext() ) {
var Contact = e.item();
if (Contact.Name == Origin){
// SendMessage code here
break;
}
}


2: please make it more clearer because i can't understand it fully.
RE: auto responding by jollyscripts on 12-23-2008 at 07:20 PM

for example

if somebody says to me

hi or hello

i want to send back a message saying hi


RE: auto responding by roflmao456 on 12-23-2008 at 08:39 PM

Well then you would have to use the ChatWndReceiveMessage event and match the Message with some string.

JScript code:
var greetings = [
"hi",
"hello",
"hey"
];

function OnEvent_ChatWndSendMessage(ChatWnd, Origin, Message){
if(Origin != Messenger.MyName) for(i in greetings) if(Message == greetings[i]) ChatWnd.SendMessage ("hi");
}