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