From: Toby D. <tj...@sf...> - 2005-05-14 01:55:03
|
You can use Swing window if you like ... Although to start with, interacting with the chatbot at the console is probably fine (e.g. Like the command-line in Python). Toby On 5/13/05 3:42 PM, "Daryl Van Humbeck" <dva...@sf...> wrote: > Do you mean like write a Swing window that lets you view what the bot > says and have a text input widget to let you talk to the bot? > > I kind of think that there should be more test bots, I'll see what I can > come up with. > > Daryl. > > > Toby Donaldson wrote: > >> Thanks Daryl, >> >> I was accidentally only looking in the csimage package. >> >> Could you make two or more chatbots, and have them talk to each other? >> >> Also, can you make a non-Jabber interface for easily testing the chatbots? >> It shouldn't be too hard. >> >> The important thing is to make sure that the design of the chatbot is >> well-done, so that you can just use the same chatbot in the Jabber interface >> or the non-jabber interface. Also, the chabot interface should not assume it >> is talking to a human or another chabot ... It should view the incoming >> messages simply as strings from some unknown source. Of course, a particular >> chatbot might be designed to work just with people, but those details should >> go into the chabot, not into the chatbot interface. >> >> Toby >> >> >> On 5/13/05 11:54 AM, "Daryl Van Humbeck" <dva...@sf...> wrote: >> >> >> >>> It should be under csjava.chatbot.*, though if you're viewing the CVS >>> tree through SourceForge's viewer, it's csjava.csjava.chatbot.*. >>> There are three files, MessageListener.java, JabberBotFramework.java, & >>> JabberBotTest.java. >>> The version numbers (if you need them) are 1.3, 1.2, & 1.1, respectively. >>> >>> I don't think that changing it from threaded to event-listening would be >>> too hard, I'd just have to change it a little bit. >>> >>> I noticed I also need to add some more JavaDoc comments to indicate what >>> certain methods do. >>> I should be updating it some soon. >>> >>> The demo I have does exactly what you suggested, though I think I might >>> be able to make it a little more interesting by sending something like >>> "You sent this:", then whatever they sent. >>> >>> Suggestions as to what it should do would be appreciated, although I >>> don't have much experience with text-based user interaction. >>> >>> Daryl. >>> >>> Toby Donaldson wrote: >>> >>> >>> >>>> Daryl, >>>> >>>> I just updated from the CVS tree, and I don't see the Jabber code. >>>> Where should I look for it? >>>> >>>> I think it's probably simpler to use events instead of threads for the >>>> asynchronous chatting, if you know what I mean. Treat the messages >>>> that come from the Jabber server like events. The Smack library should >>>> have support for this. >>>> >>>> Also, I've been chatting with a Surrey high school IT teacher about >>>> running a Turing Test contest using Jabber, and if a demo is ready I'd >>>> like to let him try it (i.e. at least chat to it). >>>> >>>> Toby >>>> >>>> Daryl Van Humbeck wrote: >>>> >>>> >>>> >>>>> Hi, all! >>>>> >>>>> The Jabber chatbot framework is now at a state of some usefulness, >>>>> you can log-in to a server, listen for messages and send messages. >>>>> >>>>> It uses Jivesoft's Smack toolkit (which made the framework code >>>>> _much_ smaller), so you'll need to download it and point the projects >>>>> classpath to two of the files, smack.jar and smackx.jar, in order to >>>>> use the program. >>>>> >>>>> Just so you know, the test program logs into jabber.org, so if only >>>>> one person uses the bot unaltered, it will log into jabber.org with >>>>> the username "csjavaChatBot," and everyone can chat with it. >>>>> >>>>> I probably shouldn't have used threads to listen for messages, but I >>>>> hadn't been sure of how it works, so I'll probably change it later. >>>>> >>>>> To log into a server, just create a new instance of >>>>> JabberBotFramework, using the host name, username, and password (and >>>>> optionally, port) that you want to use. >>>>> The constructor will throw an org.jivesoft.smack.XMPPException if a >>>>> problem occurrs, so you need to catch it. >>>>> >>>>> For examples, look at the file JabberBotTest.java in the same package >>>>> as the JabberBotFramework, csjava.chatbot.*. >>>>> >>>>> To send a message, you just call .sendMessage(msg, to), where msg is >>>>> the String message to send, and to is the username to send it to. >>>>> >>>>> To listen for messages, add a MessageListener to your copy of the >>>>> JabberBotFramework with .addMessageListener(messageListener). >>>>> >>>>> That's basically it. If you want more functionality (it currently >>>>> only supports text messages), please post saying so. >>>>> Though I'm not sure how to recieve HTML, etc. messages. >>>>> >>>>> Anyway, here it is. >>>>> >>>>> Daryl. >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >>> >> >> >> > > -- Dr. Toby Donaldson School of Computing Science Simon Fraser University |