What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » artificial intelligence script(close window)

artificial intelligence script(close window)
Author: Message:
xsouldeath
Junior Member
**


Posts: 30
Joined: Sep 2006
O.P. RE: artificial intelligence script(close window)
okay adding any two numbers(reasnoable numbers)..
like if they say 1 + 1 my program should say 2

if (Message.match(/(^|\s+)(\*)?add(d|s)?(\*)?($|\s+)/i)!=null)
{
//i was trying to find the frikken equal sign lol ..but
var plus =Message.indexOf("+");
var value1= Message.substring(0,plus)
var value2=Message.substring(plus+1,Message.length()-1)
}

okay how does the Message.match function work
because I have
if(Message.match(/(^|\s+)(\*)?1+1?(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage("duh its 2 u moron");
}
if(Message.match(/(^|\s+)(\*)?2+2?(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage("duh its 4 u moron");
}
if(Message.match(/(^|\s+)(\*)?2+5?(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage("duh its 7 u moron");
}

but when someone says add 2 + 2
it says:
"duh its 2 u moron
duh its 7 u moron"

in other words both if statements are triggered..how do i make it match exactly or properly..


and i fixed the adding thingy up a bit but still doens't add properly.
===================
if (Message.match(/(^|\s+)(\*)?add(d|s)?(\*)?($|\s+)/i)!=null)
{
var plus =Message.indexOf("+");
var value1= Message.substring(0,plus);
var value2=Message.substring(plus+1,Message.length()-1);
var final=value1+value2;
ChatWnd.SendMessage(""+final);
}

This post was edited on 09-20-2006 at 01:45 AM by xsouldeath.
09-20-2006 01:39 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
artificial intelligence script(close window) - by xsouldeath on 09-19-2006 at 11:32 PM
RE: artificial intelligence script(close window) - by cloudhunter on 09-19-2006 at 11:48 PM
RE: artificial intelligence script(close window) - by CookieRevised on 09-20-2006 at 12:19 AM
RE: artificial intelligence script(close window) - by xsouldeath on 09-20-2006 at 12:27 AM
RE: artificial intelligence script(close window) - by Spunky on 09-20-2006 at 12:30 AM
RE: artificial intelligence script(close window) - by CookieRevised on 09-20-2006 at 12:34 AM
RE: artificial intelligence script(close window) - by Lou on 09-20-2006 at 12:36 AM
RE: artificial intelligence script(close window) - by xsouldeath on 09-20-2006 at 01:39 AM
RE: artificial intelligence script(close window) - by CookieRevised on 09-20-2006 at 01:51 AM
RE: artificial intelligence script(close window) - by xsouldeath on 09-20-2006 at 02:07 AM
RE: artificial intelligence script(close window) - by CookieRevised on 09-20-2006 at 02:13 AM
RE: artificial intelligence script(close window) - by xsouldeath on 09-20-2006 at 03:13 AM
RE: artificial intelligence script(close window) - by xsouldeath on 09-20-2006 at 11:59 PM
RE: artificial intelligence script(close window) - by CookieRevised on 09-21-2006 at 09:38 AM
RE: artificial intelligence script(close window) - by xsouldeath on 09-21-2006 at 12:59 PM
RE: artificial intelligence script(close window) - by Matti on 09-21-2006 at 03:19 PM
RE: artificial intelligence script(close window) - by xsouldeath on 09-21-2006 at 07:31 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