Tuesday, June 9, 2009

Creating IRC bots

This website gives quick and easy way to code IRCbots
http://www.jibble.org/pircbot.php

Download their jar file and then only with simple 2 java files like below , you can own your own ircbot.

MyBot.java

import org.jibble.pircbot.*;

public class MyBot extends PircBot {

public MyBot() {
this.setName("MyBot");
}

}



MyBotMain.java

import org.jibble.pircbot.*;

public class MyBotMain {

public static void main(String[] args) throws Exception {

// Now start our bot up.
MyBot bot = new MyBot();

// Enable debugging output.
bot.setVerbose(true);

// Connect to the IRC server.
bot.connect("irc.freenode.net");

// Join the #pircbot channel.
bot.joinChannel("#pircbot");

}

}

It is really interesting. I never think making chatbots is so easy

0 comments: