What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [HELP]Auto respond on a specific message

[HELP]Auto respond on a specific message
Author: Message:
Jonte135
Junior Member
**


Posts: 57
– / – / Flag
Joined: Aug 2007
O.P. [HELP]Auto respond on a specific message
Well I'm going to try to make my first ever script, which will be an easy bot that I will upgrade more and more the more I learn. So what I want now is a code that "searches" through the message that someone gives me and look for a word like "hello". If it matches "hello" then it will reply randomly messages that I have in a file and the messages will simply be separated with enter. Also the thing it will search for will also be in a file that is separated with enter.

It should be fairly easy for experienced coders, but I don't know much about coding in MSN+ so ya thanks :P

EDIT: My friend forced me to post this, he made it for me, perhaps it can help :)

code:
int curWord = 0;

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
    if(Origin != Messenger.MyName) {
    var parts = sMessage.split(" ");
        while(1) {
        if(parts[curWord] == "hello" || parts[curWord] == "Hello" parts[curWord] == "HELLO") {
            ChatWnd.SendMessage("Hello.");
            break;
        }
        if(parts[curWord] == NULL) {
            break;
        }
        if(curWord >= 200) {
            break;
        }
        curWord += 1;
    }
    }
}

This post was edited on 10-18-2008 at 07:58 PM by Jonte135.
10-18-2008 07:41 PM
Profile E-Mail PM Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
RE: [HELP]Auto respond on a specific message
This does what you want, maybe you can learn from it?

http://www.msgpluslive.net/scripts/view/119-Answering-Machine-Plus/
10-18-2008 08:01 PM
Profile PM Find Quote Report
Jonte135
Junior Member
**


Posts: 57
– / – / Flag
Joined: Aug 2007
O.P. RE: RE: [HELP]Auto respond on a specific message
quote:
Originally posted by SonicSam
This does what you want, maybe you can learn from it?

http://www.msgpluslive.net/scripts/view/119-Answering-Machine-Plus/
Thanks for your help, unfortunately it seems too be a little to complicated for me at the moment :(

This post was edited on 10-18-2008 at 08:34 PM by Jonte135.
10-18-2008 08:32 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: [HELP]Auto respond on a specific message
quote:
Originally posted by Jonte135

code:
int curWord = 0;



Well, you're doing it a little bit complicated.

If you're planning to use "int" for integer numbers, "float" for floating point numbers, and so on, you'll have to either look at some reference for a thousand times, or "study" all those data types and their keyword (e.g. "int" for integer).

What's easier to use, is the "var" keyword. You can use it for most (if not all) data types:

code:
var VariableNumberOne = "Hello there"; // String
var ThisOnesUndefined; // do not use the "assign" ( "=" ) operator
var ThirdOne = 9999; // Number
var FourthIsFloat = 1.01; // also a Number
var myObject = new Object(); // don't bother yet

var Nothing = null; // never mind either

10-20-2008 08:41 AM
Profile PM Find Quote Report
Jonte135
Junior Member
**


Posts: 57
– / – / Flag
Joined: Aug 2007
O.P. RE: RE: [HELP]Auto respond on a specific message
quote:
Originally posted by SmokingCookie
quote:
Originally posted by Jonte135

code:
int curWord = 0;



Well, you're doing it a little bit complicated.

If you're planning to use "int" for integer numbers, "float" for floating point numbers, and so on, you'll have to either look at some reference for a thousand times, or "study" all those data types and their keyword (e.g. "int" for integer).

What's easier to use, is the "var" keyword. You can use it for most (if not all) data types:

code:
var VariableNumberOne = "Hello there"; // String
var ThisOnesUndefined; // do not use the "assign" ( "=" ) operator
var ThirdOne = 9999; // Number
var FourthIsFloat = 1.01; // also a Number
var myObject = new Object(); // don't bother yet

var Nothing = null; // never mind either


Ya that guy that made the script for me changed it just after I posted it :D
10-20-2008 06:09 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