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

Pages: (2): « First « 1 [ 2 ] Last »
artificial intelligence script(close window)
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: artificial intelligence script(close window)
I am not going to start explaning everything you do wrong there (which is a lot), sorry... please see the links I posted.....

They give the full detailed and extensive help which you need regarding regular expressions, and scripting in general (as you don't even need to do what you do to get the sum of those two numbers).

Explaning everything in detail on the forum would be too extensive and it also would simply end up in being a copy of what is explained in the help files (links provided in previous post).

sorry

This post was edited on 09-20-2006 at 02:52 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-20-2006 02:13 AM
Profile PM Find Quote Report
xsouldeath
Junior Member
**


Posts: 30
Joined: Sep 2006
O.P. RE: artificial intelligence script(close window)
fixed script
if (Message.match(/(^|\s+)(\*)?add(d|s)?(\*)?($|\s+)/i)!=null)
{
Message=Message.substring(3);
ChatWnd.SendMessage("attempting to add now..");
ChatWnd.SendMessage("Message is now"+Message);
var anExpression = Message;
var total = eval(anExpression); // Assigns the value 5 to the variable total.
ChatWnd.SendMessage(total.toString());
}
extensive and n00by bot script...


current bot commands:
google dog                ....
image dog             ....(google images)
huh                       ...(disses you up)
add mathetmatical operation
ex:
add 7 * 8 + 1      ...==>gives 57






.zip File Attachment: AutoBot.zip (5.74 KB)
This file has been downloaded 177 time(s).

This post was edited on 09-20-2006 at 04:01 AM by xsouldeath.
09-20-2006 03:13 AM
Profile E-Mail PM Find Quote Report
xsouldeath
Junior Member
**


Posts: 30
Joined: Sep 2006
O.P. RE: artificial intelligence script(close window)
gulp.. spot the error in this huge program
its most likely an escape character '\'
or  Message.match wrong syntax

coz it was working fine then i tried to comment stuff out with // and when i put un commented it the code died..

.zip File Attachment: autobotfix.zip (6.42 KB)
This file has been downloaded 171 time(s).

This post was edited on 09-20-2006 at 11:59 PM by xsouldeath.
09-20-2006 11:59 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: artificial intelligence script(close window)
1) try to update previous posts when you update your script. It is of no use to have 65416451 attachments in an equal amount of posts. Its very confusing that way.

2) Have you followed the suggestions (learning about how regular expressions work, basic scripting, etc)? It seems not though as your script still contains the same errors, bad programming and stuff.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-21-2006 09:38 AM
Profile PM Find Quote Report
xsouldeath
Junior Member
**


Posts: 30
Joined: Sep 2006
O.P. RE: artificial intelligence script(close window)
bad programming im sure the script contains that, but it works
you didn't really mention about the bad programming.... lol the script works and some say its better than smarterchild .. so yay :)
09-21-2006 12:59 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: artificial intelligence script(close window)
quote:
Originally posted by xsouldeath
bad programming im sure the script contains that, but it works
you didn't really mention about the bad programming.... lol the script works and some say its better than smarterchild .. so yay :)
It's not about if it works, it's about if it works good. When you release a script which contains crappy, unneeded stuff like:
code:
if (Message.match(/(^|\s+)(\*)?add(d|s)?(\*)?($|\s+)/i)!=null)
or:
code:
var anExpression = Message;
others will be confused about it and think that they have to use the same in their scripts. Then, when it doesn't work, they come here and ask why. And we don't want thar, huh? :)

A good example of bad programming is:
code:
if (Message.match(/(^|\s+)(\*)?add(d|s)?(\*)?($|\s+)/i)!=null)
This rule contains so much unneeded stuff that it could even match a string like:
quote:
Hey I thought he     *adds*  something like bananas
If you would study the regular expression and know how to write proper regexp, you'll know why. Also, this code will make your script fail or even crash since it'll try to send:
quote:
I thought he     *adds*  something like bananas
to the eval function. :-/
So: go to some tutorial site like this one and learn proper regular expressions. ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-21-2006 03:19 PM
Profile E-Mail PM Web Find Quote Report
xsouldeath
Junior Member
**


Posts: 30
Joined: Sep 2006
O.P. RE: artificial intelligence script(close window)
current glitch in bot:
when someone comes online it messages them twice instead of once..
Possible solution: add come online script to status of online instead of come online.

regexp  (WHAT IS THAT!!!???) ....
well the Message.Match i copied and pasted like 200 times
i still don't know all that it does, when i looked it up i saw something about replacing the first word with the second word...
=====================================

the script doesnt fail or crash so far ... it does occasionally trigger numerous statements that should not be what i want... but as far as adding its fine .. i guess i shouldve used the  "math" string instead. as far as Message.math i have no idea what it means

I will consider your suggetsions and check out the site

some more ideas to make the bot "fun" would be great for this as well..

well i checked the site sent but how do i make the message.match
match ONLY an exact message they type in
like "hi."
then it says "sup"

and then "hi. how are you"
says "im good"

anyways the bot has a basic word scrambler game
just type "game"
===================================
okay well anyways heres attached a java tutorial for you people...
it cludes the one available from downloads section here
as well as the matching characters and other stuff from it
My bot was able to:(well the basis of this bot was the Hey you sample program or whatever)


(anything suggestions to make the bot more fun are appreciated ... if you want to try the bot out add (again...) zerounderscore@hotmail.com):
1) message contacts when they come online
2) message contacts when they change their status
3) message contacts when they change their nickname
4) (prevent users from being messaged from the above) ==>well assuming they don't message you :P
5) play a word scramble game

ex: descramble the word lehlo
(the user types "hello")
the bot says next level ....
gives scrambled word...

6) respond to its own messages(pretty dumb..) [this you just modify the if (Origin != Messenger.MyName)

7) copycat other users(say what they say back to you))
8) give google links to search term when the user types for example:
google dog+hair
link to google for the search term "dog hair"
9) give google image links
ex: "image dog+hair"  give users link to google images with serach term dog hair
10) the bot makes comebacks to disses and responds to common phrases, it has a commands list when you type "commands"









.zip File Attachment: samplechats.zip (2.72 KB)
This file has been downloaded 168 time(s).

This post was edited on 09-22-2006 at 05:00 AM by xsouldeath.
09-21-2006 07:31 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« 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