ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/IRCBot/IRCMain.java
Revision: 1.1
Committed: Wed Feb 21 02:24:45 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
CVS Tags: PROJECT_COMPLETION, HEAD
Error occurred while calculating annotation data.
Log Message:
A test main method. Not required to actually make use of the IRCBot class.

File Contents

# Content
1 import java.io.*;
2
3 // test main method
4 // $Id$
5
6 class IRCMain {
7 public static void main(String args[]) {
8 boolean run=true;
9 // setup the IRC class and connect
10 IRCBot irc = null;
11 try {
12 irc = new IRCBot("killigrew.ukc.ac.uk", 6667, "iscreamBot", "#cs");
13 irc.connect();
14 } catch(IOException e) {
15 System.out.println(e);
16 }
17 // run a test 3 times
18 int i = 1;
19 while(run) {
20 try{Thread.sleep(60000);}catch(Exception e){}
21 irc.sendNotice("test "+i+"/3");
22 irc.sendMsg("excuse me");
23 if(i==3){run=false;}else{i++;}
24 }
25 // disconnect from the server
26 try {
27 irc.disconnect();
28 } catch(IOException e) {
29 System.out.println(e);
30 }
31 }
32 }