All pastes #168133 Raw Edit

Tanuva

public java v1 · immutable
·published 2006-09-12 18:47 UTC
rendered paste body
package tanuva.ircbot;import java.net.Socket;public class Bot {	BotInfo bInfo;	Send send;	Utils utils = new Utils();		public Bot(Socket socket, BotInfo bInfo) {		this.bInfo = bInfo;		send = new Send(socket);	}	public Bot() {}		public void run() {		send.identify(bInfo.getNick(), bInfo.getIdent(), bInfo.getRealname());		while(true) {			try {				Thread.sleep(100);			} catch(Exception e) { e.printStackTrace(); }		}	}		public void onMessage(String source, String channel, String message) {		//StringBuffer sb = new StringBuffer(message);		utils.toConsole(channel + "::" + source + ">" + message, true);	}		public void onLine(String line) {		 utils.toConsole("onLine triggered", true);	}		public void onPing(long pingcode) {			utils.toConsole("Answering a ping - code: " + pingcode, true);			try {			send.rePing(pingcode);			} catch(Exception e) { e.printStackTrace(); }	}}