import java.math.*; import javax.imageio.*; import java.awt.image.*; import java.awt.event.*; import java.awt.*; import java.security.spec.*; import java.security.*; import java.lang.management.*; import java.lang.ref.*; import java.lang.reflect.*; import java.net.*; import java.io.*; import javax.swing.table.*; import javax.swing.text.*; import javax.swing.event.*; import javax.swing.*; import java.util.concurrent.atomic.*; import java.util.concurrent.*; import java.util.regex.*; import java.util.List; import java.util.zip.*; import java.util.*; import org.jibble.pircbot.*; public class main { public static void main(String[] args) throws Exception { MyBot bot = new MyBot(); bot.setVerbose(true); bot.connect("irc.freenode.net"); bot.joinChannel("#pircbot"); } static class MyBot extends PircBot { MyBot() { setName("a12345"); setAutoNickChange(true); } public void onConnect() { listChannels(">10"); } public void onChannelInfo(String channel, int userCount, String topic) { print("Channel found: " + channel + " (" + userCount + ") - " + topic); } } static StringBuffer print_log; static void print() { print(""); } static void print(Object o) { String s = String.valueOf(o) + "\n"; synchronized(StringBuffer.class) { if (print_log == null) print_log = new StringBuffer(); } print_log.append(s); System.out.print(s); } static void print(long l) { print(String.valueOf(l)); } }