Here is a simple IRC bot written in Java...everything here works
Code:
import java.io.*;
import java.net.*;
import java.lang.*;
import javax.swing.*;
import java.awt.*;
import java.lang.Throwable.*;

public class Main {

    public static void main(String[] args) {
        // The server to connect to and our details.
        String server = "irc.freenode.net";
        String nick = "MooBot";
        String login = "tuxxman";
        String channel = "#tuxxman";

	// Connect directly to the IRC server.
        try {
        Socket socket = new Socket(server, 6667);
        BufferedWriter writer = new BufferedWriter(
                new OutputStreamWriter(socket.getOutputStream( )));
        BufferedReader reader = new BufferedReader(
                new InputStreamReader(socket.getInputStream( )));
        
        // Log on to the server.
        writer.write("NICK " + nick + "\r\n");
        writer.write("USER " + login + " 8 * : Moooo\r\n");
        writer.flush( );
        
        // Read lines from the server until it tells us we have connected.
        String line = null;
        while ((line = reader.readLine( )) != null) {
            if (line.indexOf("004") >= 0) {
                // We are now logged in.
                break;
            }
            else if

 (line.indexOf("433") >= 0) {
                System.out.println("Nickname is already in use.");
                return;
            }
        }
	 
	 
	        
		// Log on to the server.
        writer.write("NICK " + nick + "\r\n");
        writer.write("USER " + login + " 8 * : mooo\r\n");
        writer.flush( );
	
		//Join the channel.
        writer.write("JOIN " + channel + "\r\n");
        writer.write("PRIVMSG " + channel + " :ey yo dawgs\r\n");
        //part---->  writer.write("PART " + channel + "\r\n");
        writer.flush( );
		
		// Keep reading lines thisfrom the server.
        while ((line = reader.readLine( )) != null) {
            if (line.toLowerCase( ).startsWith("PING "))       {
                // We must respond to PINGs to avoid being disconnected.
                writer.write("PONG " + line.substring(5) + "\r\n");
                writer.flush( );
							 	}
	   String[] tmp = line.split(" :");
	   System.out.println(tmp[0] + "::" + tmp[1]);
	   if (tmp[1].length() >= 5) {
	   if (tmp[1].substring(0,6).equals(nick)) {
	   if (tmp[1].length() >= 11 && tmp[1].substring(7, 11).equals("say ")) {
	   String[] tmp2 = tmp[1].split("say ");
	   System.out.println(tmp[1] + "::" + tmp2[1]);
	   writer.write("PRIVMSG " + channel + " :" + tmp2[1] + "\r\n");
	   writer.flush();
	   }}}
	  
	   String[] tmp1 = line.split(" :");
	   System.out.println(tmp1[0] + "::" + tmp1[1]);
	   if (tmp1[1].length() >= 5) {
	   if (tmp1[1].substring(0,6).equals(nick)) {
	   if (tmp1[1].length() >= 12 && tmp1[1].substring(7, 12).equals("join ")) {
	   String[] tmp12 = tmp1[1].split("join ");
	   System.out.println(tmp1[1] + "::" + tmp12[1]);
	   writer.write("JOIN " + " :" + tmp12[1] + "\r\n");
	   writer.flush();
	   }}}
	   
	   String[] tmp11 = line.split(" :");
	   System.out.println(tmp11[0] + "::" + tmp11[1]);
	   if (tmp11[1].length() >= 5) {
	   if (tmp11[1].substring(0,6).equals(nick)) {
	   if (tmp11[1].length() >= 12 && tmp1[1].substring(7, 12).equals("part ")) {
	   String[] tmp112 = tmp11[1].split("part ");
	   System.out.println(tmp11[1] + "::" + tmp112[1]);
	   writer.write("PART " + " :" + tmp112[1] + "\r\n");
	   writer.flush();
	   }}}
	   

								}     
	}        
	catch (Throwable e) {
   				       }

				      
					 }
	        }
That works just fine, as you can see below:
Code:
* MooBot (n=tuxxman@c-24-3-51-234.hsd1.pa.comcast.net) has joined #tuxxman
MooBot ey yo dawgs
tuxxman MooBot say hello world
MooBot hello world
BUT....
if i change one line that should NOT matter if its changed, it fails.
I change:
Code:
        String channel = "#tuxxman";
to
Code:
        String channel = "#linuxforums";
this happens:
* MooBot (n=tuxxman@c-24-3-51-234.hsd1.pa.comcast.net) has joined #linuxforums
* MooBot has quit (Remote closed the connection)

Im completely baffled. Earlier versions of this code worked fine...and i didnt change much.
besides, why would the channel matter?
I know it isnt a problem with the nickname or login name, i changed and tested them...same problem.

Any help / solutions would be greatly appreciated!
-tuxxman