View Full Version : Ask Simon - Reference/Response Script
DMackeybog
04-08-2004, 12:30 AM
I need help, I wanted to do this kind of thing like "Ask Simon". And I need somekind of simple Reference and Respones Script. But I don't know how to do these kinds of things and I can't find much help online. This is what I wanted to do...
User Types: Do I have any friends?
So the computer looks for DO I HAVE ANY FRIENDS and it would pick the best match like I, HAVE, FRIEND = "No, Because you're a loser".
Get what I'm saying? Anybody konw of a simple script like that?
A1ien51
04-08-2004, 03:08 AM
You should look into bot scripts,
you might be able to find information by looking at sites like this: http://www.chatterboxchallenge.com/
Eric
DMackeybog
04-08-2004, 03:16 AM
:( I've already tried that. There are some online bots like that but I can't get to the script and have no idea how they work. So thanks for the help but it didn't help, lol, :) , that's like a pun or something...
A1ien51
04-08-2004, 03:39 AM
I used to have a bartender AIM bot
what you need to do is build up a database (array) of words
You need to teach it to recognize words and what they mean. IT IS NO SIMPLE TASK. You are talking about AI here which is hard to do.
I would recommend looking into a AIM bot since people already have the logic built: http://www.runabot.com/ But you would be programming it in perl, but I had no trouble picking it up.
Eric
DMackeybog
04-08-2004, 03:48 AM
I don't really think I need an AI bot that can provide conversation. I need some kind of...
05 If INPUT = "I" and "Have" and "Friend" then print "No, You have no friends because you're a loser" ; eles goto 10
But that's how you would do it in QBasic, I need to do that in Javascript (or something) and I can't firgure out how to do it.
Philip M
04-08-2004, 07:56 AM
Posted twice for some reason. Sorry!
Philip M
04-08-2004, 07:57 AM
Are you sure that what you are trying to do is worth the effort involved? Your computerised responses are not so hilariously funny that anyone will want to try it twice.
Here is a possible way to go about it:-
function A1(which) {
var A1words = new Array ('I ', 'have ', 'friend '); // 3 words
var textinput = which.value; // what the user types in
for (i = 0; i < textinput.length; i++) {
if (textinput.indexOf(A1words[i]) == 2) { // all words present
alert ("You are a loser");
}
else ...........
But of course you will need a function for every response you envisage the user will make. Note that if the user misspells "freind" then it does not work.
This sort of thing is very complicated to achieve in practice and is fraught with problems.
DMackeybog
04-08-2004, 05:08 PM
Ya, I see what you mean about misspelling things... well, I think I'll trying using something like the web bot from www.zabaware.com and try to pick-apart their source code, thanks alot. Cya
--Oh ya, I about the responsis, it's like a joke between me and my friends. We were at this party and we got into this conversasion about how thoses foturne telling lady/machins (you know, the one were the mechaical lady is in that box and she put's her hand on the crystal ball and a little card comes out with you're fourtune) are allways like "Things are looking up" and never say anything like "You're car is being towed...", and I said I might be able to figure something like that out with QBasic and their like, "try Javascript and then you can put it on the website"(I have a website)... so that's my story
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.