From 5529f25dec5a955e0b8ab54c6937c2889ef65ad8 Mon Sep 17 00:00:00 2001 From: Don Seiler Date: Mon, 28 Feb 2005 19:19:53 +0000 Subject: Reminders working --- users/rizzo/rizbot/build.xml | 66 ++++++++++++++++++++++ users/rizzo/rizbot/run.sh | 2 +- .../rizbot/src/org/gentoo/rizzo/rizbot/RizBot.java | 8 ++- 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 users/rizzo/rizbot/build.xml (limited to 'users/rizzo') 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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(); + } } -- cgit v1.2.3-65-gdbad