PircBot is a Java framework for writing IRC bots quickly and easily.
Tutorial Details:
Its features include an event-driven architecture to handle common IRC events, flood protection, DCC resuming support, ident support, and more. Its comprehensive logfile format is suitable for use with pisg to generate channel statistics. Full documentation is included, and this page contains a 5-minute step-by-step guide to making your first IRC bot.
PircBot allows you to perform a variety of fun tasks on IRC, but it is also used for more serious applications by the US Navy, the US Air Force, the CIA (unconfirmed) and several national defence agencies. But don't let that put you off - it's still easy to use!
In this example, we shall take you through how to make an IRC Bot that responds to a simple command. This should take no more than 5 minutes if you work fast. It will send a message to the channel saying what the local time is whenever someone says "time".
First, let's create a directory in which we can store the code for your IRC Bot. For this example, we shall be using c:\mybot\
Download the PircBot jar archive (see above) and save this in c:\mybot\
We now need to create our own IRC Bot by extending the functionality of PircBot. We can do this by creating MyBot.java in our directory (note that Java is case sensitive). To extend the PircBot without introducing any of our own functionality, all we need to do is put the following in the file named MyBot.java: -
import org.jibble.pircbot.*;
public class MyBot extends PircBot {
public MyBot() {
this.setName("MyBot");
}
}
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: PircBot Java IRC API Resources
View Tutorial: PircBot Java IRC API Resources
Related
Tutorials:
|