View Full Version : Creating a Javascript bot using <textarea>

12-16-2007, 05:43 AM
I would like to know a good code example of a JavaScript Bot. One is basically where you have a <textarea> and a single line. You would type in the single line "Hello Bot, how are you?" and in the textarea it would appear something like this:

How are you?
JSBot: Good, thanks for asking.

You get where I'm going at? A example is this: http://pac-txt.com/. But without the pacman concept. :P

Also I'm sure it would have to do something with the "if" statement. Where if you typed something, something else would appear.

12-16-2007, 07:31 AM
That's no simple feat. While I don't know of a JS bot, here's a site with a Haskell bot and its source code, "Lambdabot" :

Might be useful to look at despite being an entirely different language. (I suppose you could use a functional js library if you wanted to translate it.)

12-16-2007, 07:46 AM
While I don't know of a JS bot

I don't know too and I don't post this thread until now because of that.
Are many chat bots implementation in many language, most of them are based on elisa.
If you want to write one in js I think that a good start point is alice:


Anyway you must coding the engine first not the user interface, :)

best regards