Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java

Name: HALP 2010-04-23 16:09

Sup anon

Hi there,

I am having problems with my IRC bot coded in Java. I can't for the life of me print out the values stored within token[] to print to a single line.

My program consists of 2 classes, a main class "ircbot" and a class "Bot".

The code i am having problems with is

Pattern sayRegex = Pattern.compile("!say", Pattern.CASE_INSENSITIVE);
                Matcher say = sayRegex.matcher(currLine);
                if (say.find() && ownership.find()) {
                    String[] token = currLine.split(" ");
                    for (int i = 4; i < token.length; i++) {
                        JavaBot.say(token[i]);
                    }
                }

And the "say" function located in the Bot class is

        public void say(String message) throws IOException {
        bw.write("PRIVMSG " + channel + " :" + message + "\n");
        bw.flush();
    }


As you can see, if i were to type !say 1 2 3 4 5 6

The output would be;

1
2
3
4
5
6

How could i print the numbers on the same line?

Thanks

Name: Anonymous 2010-04-23 19:09

>>13
It doesn't piss us off. Helping is not the purpose of this board; there are plenty of places that already have that purpose. So when people try to fit their fucking square peg into our fucking circle anus, it's kinda depressing.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List