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(); } } }