English 中文(简体)
在 Java建造一个ir客户
原标题:Building an irc client in Java
  • 时间:2010-10-02 06:28:52
  •  标签:
  • java
  • irc

I m trying to write an ircBot in Java for some practice. I am using this sample code as the base. I m trying to figure out how to get it to read in text from my console so I can actually talk to people with the bot. There s the one while loop that takes in the input from the ircserver and spits it out to console and responds to PINGs. I m assuming I have to have another thread that takes the input from the user and then uses the same BufferedWriter to spit it out to the ircserver again but I can t get that figured out. Any help would be awesome!

问题回答

在你与读物和作家有关的编码中,的确与你与ICC服务器建立的双向车库的中途和离去端有关。

因此,为了从用户那里获得投入,你确实是另一个线索,需要用户以某种方式指挥,并采取行动。 最基本的模式自然是使用系统。 为此,最好总结一下,以便你能够从用户那里收回全部线性投入,并将这些投入作为指挥。

从系统读到全线。 你们可以这样做:

BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
String line;
while ((line = bin.readLine()) != null) {
    // Do stuff
}

也可考虑使用位于 Java的CLI图书馆之一,例如

如果你真的想要放弃某种好处,我建议(在广泛使用之后)改用pircbot。 皮坎博特人确实是一个好奇的图书馆,将让你们看到一个伊委会的机器人,并在几分钟内运作。 现场的一些例子,很容易使用。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签