Exemplo n.º 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");
  }
Exemplo n.º 2
0
  public IrcHelper(TwimpGame game) {

    this.game = game;

    // debugging output
    this.setVerbose(true);

    this.setName("uaBArtBot");
    // Connect to the IRC server.
    try {
      this.connect("irc.twitch.tv", 6667, "oauth:9ldmg9z1p0uesld6gpa0cqn3i2btkt");
    } catch (IOException e) {
      e.printStackTrace();
    } catch (IrcException e) {
      e.printStackTrace();
    }

    // Join the #uabart channel.
    this.joinChannel("#uabart");
  }
Exemplo n.º 3
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();
      }
    }
  }