/** Class constructor */ public TinkerBot() { // Initialize globals data = Storage.readStorage("data.bin"); con = new ConnectionManager(new Profile(data.botName)); command_char = "!"; users = new HashMap<String, User>(); announcer = null; announcerStr = null; announcerPeriod = -1; announcerRunning = false; awayList = new ArrayList<String>(); // Start TinkerBot con.requestConnection(data.server).addIRCEventListener(this); new Timer() .scheduleAtFixedRate( new TimerTask() { @Override public void run() { cmdSave(); } }, 60 * 500, 60 * 500); // save data every 30 seconds }
/** Quit command */ private void cmdQuit() { Storage.writeStorage("data.bin", data); con.quit(); System.exit(0); }