diff options
author | Don Seiler <rizzo@gentoo.org> | 2005-02-28 19:19:53 +0000 |
---|---|---|
committer | Don Seiler <rizzo@gentoo.org> | 2005-02-28 19:19:53 +0000 |
commit | 5529f25dec5a955e0b8ab54c6937c2889ef65ad8 (patch) | |
tree | 0625697a54ef0bc3014027da8a37926e30ea2de9 /users/rizzo | |
parent | Moving (diff) | |
download | gentoo-5529f25dec5a955e0b8ab54c6937c2889ef65ad8.tar.gz gentoo-5529f25dec5a955e0b8ab54c6937c2889ef65ad8.tar.bz2 gentoo-5529f25dec5a955e0b8ab54c6937c2889ef65ad8.zip |
Reminders working
Diffstat (limited to 'users/rizzo')
-rw-r--r-- | users/rizzo/rizbot/build.xml | 66 | ||||
-rw-r--r-- | users/rizzo/rizbot/run.sh | 2 | ||||
-rw-r--r-- | users/rizzo/rizbot/src/org/gentoo/rizzo/rizbot/RizBot.java | 8 |
3 files changed, 74 insertions, 2 deletions
diff --git a/users/rizzo/rizbot/build.xml b/users/rizzo/rizbot/build.xml new file mode 100644 index 0000000000..200584d8d5 --- /dev/null +++ b/users/rizzo/rizbot/build.xml @@ -0,0 +1,66 @@ +<?xml version="1.0"?> + +<!-- +$Id: build.xml,v 1.1 2005/02/28 19:19:53 rizzo Exp $ +--> + +<project name="rizbot" default="dist" basedir="."> + + <!-- Read in build property file for any user customizations --> + <property file="build.properties" /> + <property file="${user.home}/build.properties" /> + <property environment="env" /> + + <!-- Directories --> + <property name="src" value="src" /> + <property name="build" value="build" /> + <property name="dist" value="." /> + + <property name="debug" value="true" /> + <property name="name" value="rizbot" /> + <property name="copyright" value="2005 Don Seiler" /> + <property name="url" value="http://dev.gentoo.org/~rizzo/rizbot/" /> + + <!-- TARGETS --> + + <target name="init"> + <!-- Create the time stamp --> + <tstamp /> + + <!-- Create the needed directories --> + <mkdir dir="${build}" /> + <mkdir dir="${dist}" /> + <mkdir dir="${dist}/lib" /> + </target> + + <target name="compile" depends="init"> + <javac srcdir="${src}" destdir="${build}" + deprecation="on" + debug="true" + debuglevel="lines,vars,source"> + <classpath> + <pathelement path="${classpath}" /> + <pathelement location="lib/pircbot.jar" /> + <pathelement location="lib/PieSpy.jar" /> + <pathelement location="lib/Reminder.jar" /> + <pathelement location="lib/JMegaHal.jar" /> + </classpath> + </javac> + </target> + + <target name="dist" depends="compile"> + <!-- Put everything in ${build} into jar file --> + <jar jarfile="${dist}/lib/rizbot.jar" basedir="${build}"> + <manifest> + <attribute name="Main-Class" value="org.gentoo.rizzo.rizbot.RizBot" /> + </manifest> + </jar> + </target> + + <target name="clean"> + <!-- Delete the ${build} and ${dist} directory trees --> + <delete dir="${build}"/> + <delete file="${dist}/lib/rizbot.jar"/> + </target> + +</project> diff --git a/users/rizzo/rizbot/run.sh b/users/rizzo/rizbot/run.sh index 13721888d5..31d38c6644 100644 --- a/users/rizzo/rizbot/run.sh +++ b/users/rizzo/rizbot/run.sh @@ -1,2 +1,2 @@ #!/bin/sh -java -Djava.awt.headless=true -classpath .:./lib/pircbot.jar:./lib/PieSpy.jar:./lib/JMegaHal.jar:./lib/Reminder.jar org.gentoo.rizzo.rizbot.RizBot ./config.ini +java -Djava.awt.headless=true -classpath ./lib/rizbot.jar:./lib/pircbot.jar:./lib/PieSpy.jar:./lib/JMegaHal.jar:./lib/Reminder.jar org.gentoo.rizzo.rizbot.RizBot ./config.ini diff --git a/users/rizzo/rizbot/src/org/gentoo/rizzo/rizbot/RizBot.java b/users/rizzo/rizbot/src/org/gentoo/rizzo/rizbot/RizBot.java index 0855bc976d..31ec86b399 100644 --- a/users/rizzo/rizbot/src/org/gentoo/rizzo/rizbot/RizBot.java +++ b/users/rizzo/rizbot/src/org/gentoo/rizzo/rizbot/RizBot.java @@ -27,6 +27,7 @@ import org.jibble.socnet.*; import org.jibble.reminderbot.*; import java.util.*; +import java.util.regex.*; import java.awt.image.BufferedImage; import java.io.*; @@ -34,11 +35,12 @@ import java.io.*; * RizBot extends PircBot to connect to IRC. It duplicates PieSpy, and adds * JMegaHal and ReminderBot features. * - * $Id: RizBot.java,v 1.1 2005/02/28 19:03:24 rizzo Exp $ + * $Id: RizBot.java,v 1.2 2005/02/28 19:19:53 rizzo Exp $ */ public class RizBot extends PircBot implements Runnable { public static final String VERSION = "RizBot 0.1.0"; + private static final String REMINDER_FILE = "reminders.dat"; private JMegaHal hal; public RizBot(Configuration config) throws IOException { @@ -52,6 +54,8 @@ public class RizBot extends PircBot implements Runnable { hal = new JMegaHal(); hal.addDocument("file:///home/dseiler/cvs/gentoo/gentoo/users/rizzo/rizbot/h2g2_dialogue.txt"); + dispatchThread = new Thread(this); + dispatchThread.start(); } // Overriden from PircBot. @@ -111,6 +115,8 @@ public class RizBot extends PircBot implements Runnable { Reminder reminder = new Reminder(channel, sender, reminderMessage, set, due); sendMessage(channel, sender + ": Okay, I'll remind you about that on " + new Date(reminder.getDueTime())); reminders.add(reminder); + dispatchThread.interrupt(); + } } |