1 |
tdb |
1.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 |
|
|
} |