]>
Commit | Line | Data |
---|---|---|
b1d4498c | 1 | /**\r |
2 | #\r | |
cb67c259 O |
3 | # The Q bot\r |
4 | # Channelservice\r | |
b1d4498c | 5 | #\r |
6 | \r | |
7 | #\r | |
8 | # Copyright (C) 2004 Ozafy - ozafy@borknet.org - http://www.borknet.org\r | |
9 | #\r | |
10 | # This program is free software; you can redistribute it and/or\r | |
11 | # modify it under the terms of the GNU General Public License\r | |
12 | # as published by the Free Software Foundation; either version 2\r | |
13 | # of the License, or (at your option) any later version.\r | |
14 | #\r | |
15 | # This program is distributed in the hope that it will be useful,\r | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of\r | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r | |
18 | # GNU General Public License for more details.\r | |
19 | #\r | |
20 | # You should have received a copy of the GNU General Public License\r | |
21 | # along with this program; if not, write to the Free Software\r | |
22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\r | |
23 | #\r | |
b1d4498c | 24 | */\r |
b1d4498c | 25 | import java.io.*;\r |
cb67c259 | 26 | import java.net.*;\r |
b1d4498c | 27 | import java.util.*;\r |
cb67c259 O |
28 | import javax.swing.Timer;\r |
29 | import java.awt.event.ActionEvent;\r | |
30 | import java.awt.event.ActionListener;\r | |
b1d4498c | 31 | \r |
32 | /**\r | |
cb67c259 | 33 | * The mail class of the Q IRC Bot.\r |
b1d4498c | 34 | * @author Ozafy - ozafy@borknet.org - http://www.borknet.org\r |
35 | */\r | |
cb67c259 | 36 | public class XmlTimer implements Runnable\r |
b1d4498c | 37 | {\r |
cb67c259 O |
38 | private X Bot;\r |
39 | \r | |
40 | Timer timer;\r | |
41 | \r | |
b1d4498c | 42 | /**\r |
cb67c259 | 43 | * Runnable programs need to define this class.\r |
b1d4498c | 44 | */\r |
cb67c259 | 45 | public void run()\r |
b1d4498c | 46 | {\r |
2849e209 | 47 | int delay = 30*60*1000; //min*sec*milisec\r |
cb67c259 O |
48 | ActionListener taskPerformer = new ActionListener()\r |
49 | {\r | |
50 | public void actionPerformed(ActionEvent evt)\r | |
51 | {\r | |
2849e209 | 52 | Bot.timerEvent();\r |
cb67c259 O |
53 | }\r |
54 | };\r | |
55 | timer = new Timer(delay, taskPerformer);\r | |
56 | timer.start();\r | |
b1d4498c | 57 | }\r |
58 | \r | |
cb67c259 O |
59 | /**\r |
60 | * Set the tutorial\r | |
61 | */\r | |
62 | public XmlTimer(X Bot)\r | |
b1d4498c | 63 | {\r |
cb67c259 | 64 | this.Bot = Bot;\r |
b1d4498c | 65 | }\r |
66 | \r | |
cb67c259 | 67 | public void stop()\r |
b1d4498c | 68 | {\r |
cb67c259 | 69 | timer.stop();\r |
b1d4498c | 70 | }\r |
cb67c259 | 71 | }//end of class |