Shoutbox

[Request] Very Simple Responder - 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: [Request] Very Simple Responder (/showthread.php?tid=90182)

[Request] Very Simple Responder by sam06 on 04-15-2009 at 08:52 PM

I was hoping someone could quickly notch this up for me, it should be VERY simple.

Basically, when MSN recieves a message, it responds with the first phrase in a list.
The next message responses with the second phrase.
And so on, until all the phrases have gone, at which it just goes back to the first phrase.

Could someone quickly make it for me? It should be simple.

Many thanks, I really appreciate this.

Sam


RE: [Request] Very Simple Responder by sam06 on 04-15-2009 at 09:01 PM

I should say, like the 'Personalised Status', but so it looks like a message, not an auto response


RE: [Request] Very Simple Responder by roflmao456 on 04-16-2009 at 04:08 AM

Using:
- Event ChatWnd_ReceiveMessage
- Func ChatWnd::SendMessage

There is no on/off switch. I want you to try out Plus! scripting and create a boolean variable.

JScript code:
var messages = new Array(), i=0;
messages[0] = "First Message";
messages[1] = "Second Message";
messages[2] = "Third Message";

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message){
if(Origin != Messenger.MyName){
if(i == messages.length)i=0;
ChatWnd.SendMessage(messages[i++]);
}
}

RE: [Request] Very Simple Responder by sam06 on 04-16-2009 at 07:40 AM

Hey- Many thanks- that's brilliant!

Do you know how to make it work with each contact, because atm it;s sending different messages to different contacts; no idea how to sort this.

Any ideas?


RE: [Request] Very Simple Responder by roflmao456 on 04-18-2009 at 07:00 AM

I get what you mean. Here is the new code:

JScript code:
var messages = new Array(), i=new Array();
messages[0] = "First Message";
messages[1] = "Second Message";
messages[2] = "Third Message";

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message){
if(Origin != Messenger.MyName){
if(!i[ChatWnd.Handle])i[ChatWnd.Handle]=0;
if(i[ChatWnd.Handle] == messages.length)i[ChatWnd.Handle]=0;
ChatWnd.SendMessage(messages[i[ChatWnd.Handle]++]);
}
}

This SHOULD work although I haven't tested it.