raisedragon / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

Why does my 8all command not work as expected #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Run the Attached code
2.
3.

What is the expected output? What do you see instead?
the expected output is a random message from a certain array in the code. 
Instead the bot quits with "Remote Host closed the connection"

What version of the product are you using? On what operating system?
I am using the latest pircbotx on Debian Linux 6.0.3

Please provide any additional information below.
I have not included the other source code. If you want them please comment and 
i will attach them in a following comment.

Original issue reported on code.google.com by netgooguy@googlemail.com on 8 Nov 2011 at 9:12

Attachments:

GoogleCodeExporter commented 9 years ago
I made a mistake and attached the wrong file.
The attached .java files are the bot source code.

Thank you.

Original comment by netgooguy@googlemail.com on 8 Nov 2011 at 9:15

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the detailed bug report. It took me a second to figure it out, but 
I'm pretty sure you didn't mean this in QuitCommand. Properly formatted, it 
looks like this:

public void onMessage(MessageEvent event) {
    if (event.getMessage().equals("!stop"))
        event.respond("Stopping");
    System.exit(0); //<--Die when a message is sent
}

Its just outside of your if statement. Put it inside of the if statement and it 
will do what you intend.

Original comment by Lord.Qua...@gmail.com on 9 Nov 2011 at 1:17

GoogleCodeExporter commented 9 years ago
Thank you for the speedy reply.

Original comment by netgooguy@googlemail.com on 9 Nov 2011 at 4:02