timothy falconer's semantic weblog
Big Fractal Tangle


RDF
 
first steps

So how does one create a bot? Well, she needs a way to talk with people, which means some kind of command-line interace with a scrolling text pane. I could use a terminal window, an IM chat window, or an IRC client. The latter seems best, as it allows others to easily chat with her as well. Smilla will have many teachers.

So what channel will she frequent? I currently run two channels on freenode: #immuexa (my company channel) and #etoys (for Squeak Etoys). Waverly lives on both, logging all talk and injecting optional simplistic call/response chatter. Smilla will need her own space from the start. I’ll call it simply #smilla.

Just joined the room. Good, it’s not being used by anyone. Next step is to get freenode’s ChanServ to protect it


/msg chanserv register #smilla newpass

/msg chanserv set #smilla guard on

Notice: The GUARD flag has been set for channel #smilla.

Hello ChanServ! Welcome to the #smilla channel. Now to get our third room participant up and running, which means delving into my Storybot code, which is currently used only for Waverly.

Open up IntelliJ, my Java IDE. I’ll use the Squeakland project, since that website’s the only production site using the newest 3.2 version of Storymill. All others are still stuck on version 2.2 from a year and a half ago.

Open up the com.immuexa.storymill.storybot package. Seven files … one constants interface, one exception class, three struts actions, one experimental RDF class, and the main class SmStoryBot.

My first question for this file is: can I start more than one bot easily?


SmStoryBot aStoryBot = ( SmStoryBot ) aApp.getAttribute( NM_STORYBOT );

Guess not. I can have multiple channels, but only one bot. So what does this class give me that I need? Startup, initialization, logging. Too much. Looks like it’s time for some major refactoring. Let’s separate the concerns: SmBotManager, SmBotChannel, SmBotLogger, SmBotHandler.

This might take a while.

Comments are closed.