Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8379113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:05:32+00:00 2026-06-09T16:05:32+00:00

I have an IRC bot which hosts game servers given a few arguments. The

  • 0

I have an IRC bot which hosts game servers given a few arguments. The problem is, once it hosts a server, it stops listening to IRC (meaning realistically, only one server can be hosted at a time). This is not what I want.

I assumed threading would be the answer to my problem, but I can’t seem to get it to work. It appears that it doesn’t actually start in another thread?

Here is my main class which starts and runs the method via threading:

// Everything is okay, run the server.
Runnable r = new Server(this, channel);
Thread thread = new Thread(r);
thread.start();

And here is the Server class which (presumably) controls the threading:

public class Server extends PircBot implements Runnable  {

public void run() {

}

public Server (bot BotRun, String channel) {
    String names[] = org.bestever.bebot.bot.hostbuilder.split(" ");
    ProcessBuilder pb = new ProcessBuilder(names);
    pb.redirectErrorStream(true);
    try {
        Process proc = pb.start();
        BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
        String strLine = null;
        while((strLine = br.readLine()) != null) {
            // Returns UDP Initialized if the server was successfully started
            if (strLine.equalsIgnoreCase("UDP Initialized.")) {
                BotRun.sendMessage(channel, "Server started successfully.");
            }
            // Returns Bad Hex Number if there is a problem with the WAD file
            else if (strLine.startsWith("Bad hex number")) {
                BotRun.sendMessage(channel, "Error starting server: "+strLine);
            }
            System.out.println(strLine);
        }
        Thread.currentThread().interrupt();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

Have I not actually started it in a thread? Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:05:34+00:00Added an answer on June 9, 2026 at 4:05 pm

    I am afraid, not.

    Server class should be more like:

    public class Server extends PircBot implements Runnable {
    
        private bot BotRun;
        private String channel;
        public void run() {
            String names[] = org.bestever.bebot.bot.hostbuilder.split(" ");
            ProcessBuilder pb = new ProcessBuilder(names);
            pb.redirectErrorStream(true);
            try {
                Process proc = pb.start();
                Reader reader = new InputStreamReader(proc.getInputStream());
                BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
                String strLine = null;
                while((strLine = br.readLine()) != null) {
                    // Returns UDP Initialized if the server was successfully started
                    if (strLine.equalsIgnoreCase("UDP Initialized.")) {
                        BotRun.sendMessage(channel, "Server started successfully.");
                    }
                    // Returns Bad Hex Number if there is a problem with the WAD file
                    else if (strLine.startsWith("Bad hex number")) {
                        BotRun.sendMessage(channel, "Error starting server: "+strLine);
                    }
                    System.out.println(strLine);
                }
                reader.close();
                Thread.currentThread().interrupt();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    
        public Server (bot BotRun, String channel) {
            this.BotRun = BotRun;
            this.channel = channel;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For our company I'd like to have a Python based IRC bot which checks
I used to have a working IRC bot, which I affectionately named shakybot, for
I have made my IRC bot and I've run into the problem of flooding.
I have a class Server which talks to a server connection for IRC. It
I have a python IRC bot that I'm starting to work on to practice
i been trying to code an IRC bot, while i have succeed. I am
I've been working on creating a simple IRC bot, which I want to give
alright, so im making an irc bot, and im wondering a few ways that
I have a simple IRC socket that is used to communicate with servers for
I have a simple flash socket that I use to connect to IRC servers.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.