Example #1
0
  /**
   * Trolotovin
   *
   * @param args parametrit
   */
  public static void main(String[] args) {

    // Luodaan se
    IRCbotti trolotov = new IRCbotti("Trolotov");

    // debug päälle
    trolotov.setVerbose(true);

    // yhdistä
    try {
      trolotov.connect("irc.cs.hut.fi");
    } 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();
    }

    // joinaa
    trolotov.joinChannel("#olotov");
  }
Example #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();
      }
    }
  }