FreenodeJavabot

HomePage | RecentChanges | Preferences

The 'strutsbot' that (occasionally, when I'm online and remember to start it,) inhabits the #struts channel on chat.freenode.net is an instance of fn-javabot.

It responds to all messages. In addition, you can address it with a message beginning with '|' (a piping symbol) or its name.

For sample commands, see the javabot [SYSTEM_TEST] file. Remember to replace ~ with | if you're talking to the strutsbot.

It does not do Javadoc-- ask javabot instead.

TODO

Local Setup

Start hsqldb:

cd $files/strutsbot-db
java -cp c:\java\hsqldb\lib\hsqldb.jar org.hsqldb.Server -database.0 file:c:\path\to\strutsbot-db -dbname.0 strutsbot

Create tables. This is a modified version of the provided javabot.sql file, using IDENTITY instead of a SEQUENCE.

CREATE TABLE factoids(
	id IDENTITY,
	name VARCHAR(255) NOT NULL,
	value VARCHAR(2000) NOT NULL,
	username VARCHAR(100) NOT NULL,
	updated TIMESTAMP
	);

CREATE TABLE changes(
	message VARCHAR(4000) NOT NULL,
	changeDate TIMESTAMP
	);

Modify ~/sqltool.rc to provide connection information for urlid=strutsbot.

      > java -jar c:\java\hsqldb\lib\hsqldb.jar strutsbot javabot.sql

Read the README (see patch below) and modify config.xml, build.properties.sample, build.properties

Compile and start the bot:

$ cd $svn/strutsbot
$ ant
$ ant run
The following error at startup doesn't seem to cause a problem. I think it happens when there is no existing instance to kill off.
killbot:
     [java] Javabot.java:114:javabot.Javabot.loadOperationInfo
     [java] Exception in thread "main" java.net.ConnectException: Connection ref
used: connect

Stop hsqldb:

      >java -jar c:\java\hsqldb\lib\hsqldb.jar strutsbot
      sql> SHUTDOWN;
      sql> \q

Configuration

To make it respond to all messages, in addition to responding to its name and '|', put the blank message tag at the bottom of the list in config.xml:

	<message tag="|"/>
	<message tag="strutsbot: "/>
	<message tag="strutsbot, "/>
	<message tag="strutsbot "/>
        <message tag="" />

Patch for fn-javabot README

Index: README
===================================================================
--- README	(revision 154)
+++ README	(working copy)
@@ -4,8 +4,15 @@
 
 Edit config.xml, following the instructions in the comments (everything between <!-- and --> in that file).
 
-Run ant from the root (e.g., cd /home/me/javabot; ant), then run ./restart.sh
+Edit build.properties.sample, then copy it to build.properties. (Yes, you need both.  Don't ask me why.)
 
-You might need to make restart.sh executable before this will work (chmod +x restart.sh).
+Set up the database tables using the script found in javabot/etc/javabot.sql.  
+You may need to modify the script to suit your database.
 
+If you are not using PostgreSQL, add the jar containing your JDBC driver to javabot/lib.
+
+To compile, execute 'ant' from the project root (e.g., cd /home/me/javabot; ant)
+
+To start the bot, execute 'ant run' from the project root.
+ 
 Good luck, and drop us a line at ricky_clarkson@yahoo.com and javabot@cheeseronline.org with any feedback/patches.

References


HomePage | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited August 26, 2006 12:09 pm by WendySmoak (diff)
Search: