Exemple #1
0
    public void checkDoor() {
      String x = "";
      while (true) {

        try {

          Thread.sleep(500);
          if (!getBash("cat door.txt")[0].equals(x)) {
            x = getBash("cat door.txt")[0];

            sendMessage(channel, "door iz " + getBash("cat door.txt")[0]);
          }

        } catch (Exception e) {
          System.out.println(e.getMessage());
          sendMessage(channel, e.getMessage());
        }
      }
    }
Exemple #2
0
  protected void onDisconnect() {
    // TODO Auto-generated method stub
    super.onDisconnect();
    while (true) {

      try {
        Thread.sleep(60000);
        reconnect();
      } catch (NickAlreadyInUseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (IrcException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
  }
Exemple #3
0
 public void onMessage(
     String channel, String sender, String login, String hostname, String message) {
   Thread t = new Thread(new shell(channel, sender, login, hostname, message));
   t.start();
 }