GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


Example bot in java by statler
1
 
import org.jibble.pircbot.*;

public class StatBot extends PircBot
{
    public StatBot()
    {
        this.setName("StatBot");
    } // constructor

    public static void main(String[] args) throws Exception 
    {
        StatBot bot = new StatBot();
        bot.connect("irc.enterthegame.com");
        bot.joinChannel("#opengl");
        bot.sendMessage("#opengl", "Huzzah!!");
    } // main

    public void onMessage(String channel, String sender,
            String login, String hostname, String message) 
    {
        if (message.equalsIgnoreCase("hello")) 
        {
            sendMessage(channel, "Hi there " + sender + "!");
        } // if
    } // onMessage

} // StatBot