Advertisement
Guest User

Untitled

a guest
Jul 24th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. public class PircBotXJoergModeExample extends ListenerAdapter {
  2. @Override
  3. public void onMessage(MessageEvent event) throws Exception {
  4. if (event.getMessage().equals("?reconnect"))
  5. event.getBot().sendIRC().quitServer();
  6. else if (event.getMessage().equals("?stop")) {
  7. event.getBot().stopBotReconnect();
  8. event.getBot().sendIRC().quitServer();
  9. }
  10. }
  11.  
  12. public static void main(String[] args) throws IOException, IrcException {
  13. Configuration config = new Configuration.Builder()
  14. .setName("PircBotX-Reconnect")
  15. .setServer("irc.freenode.net", 6667)
  16. .addAutoJoinChannel("#pircbotx")
  17. .setAutoReconnect(true)
  18. .addListener(new PircBotXJoergModeExample())
  19. .buildConfiguration();
  20.  
  21. PircBotX bot = new PircBotX(config);
  22. bot.startBot();
  23. }
  24. }
  25.  
  26. ----
  27.  
  28.  
  29. 19:25:07.480 [main] INFO org.pircbotx.InputParser - :TheLQ!~LordQuack@74-141-215-186.dhcp.insightbb.com PRIVMSG #pircbotx :?reconnect
  30. 19:25:07.481 [listenerPool0-thread3] INFO org.pircbotx.output.OutputRaw - QUIT :
  31. 19:25:07.575 [main] INFO org.pircbotx.InputParser - :PircBotX-Reconne!~PircBotX@74-141-215-186.dhcp.insightbb.com QUIT :Client Quit
  32. 19:25:07.605 [main] INFO org.pircbotx.InputParser - ERROR :Closing Link: 74-141-215-186.dhcp.insightbb.com (Client Quit)
  33. 19:25:07.607 [main] INFO org.pircbotx.dcc.DccHandler - Terminating all transfers waiting to be accepted
  34. 19:25:07.608 [main] DEBUG org.pircbotx.PircBotX - Disconnected.
  35. 19:25:07.608 [main] DEBUG o.p.h.m.ThreadedListenerManager - Waiting for listener org.pircbotx.impl.PircBotXJoergModeExample@3490b317 to execute event MessageEvent(channel=Channel(name=#pircbotx, channelId=5601a159-566d-40f2-8913-77735c21d882, dao=org.pircbotx.UserChannelDao@29b7458a, bot=Version{PircBotX 2.0-SNAPSHOT, a fork of PircBot, the Java IRC bot - pircbotx.googlecode.com} Connected{false} Server{irc.freenode.net} Port{6667} Password{null}, output=org.pircbotx.Channel$1@12227539, mode=, topic=Official PircBotX Test Channel | http://pircbotx.googlecode.com/ | ?help to use TheLQ-PircBotX example bot, topicTimestamp=1365448714000, createTimestamp=0, topicSetter=TheLQ, moderated=false, noExternalMessages=false, inviteOnly=false, secret=false, channelPrivate=false, topicProtection=false, channelLimit=-1, channelKey=null, modeStale=false, modeLatch=null), user=User(bot=Version{PircBotX 2.0-SNAPSHOT, a fork of PircBot, the Java IRC bot - pircbotx.googlecode.com} Connected{false} Server{irc.freenode.net} Port{6667} Password{null}, dao=org.pircbotx.UserChannelDao@29b7458a, userId=9057ff04-c53a-4167-b3f8-055b38daa9e8, output=org.pircbotx.User$1@21920208, nick=TheLQ, realName=, login=, hostmask=, away=false, ircop=false, server=, hops=0), message=?reconnect)
  36. 19:25:08.481 [main] INFO org.pircbotx.PircBotX - Shutdown has been called, closing InputParser
  37. 19:25:08.523 [main] DEBUG org.pircbotx.PircBotX - Trying address irc.freenode.net/193.219.128.49
  38. .....
  39. 19:25:53.536 [main] INFO org.pircbotx.InputParser - :TheLQ!~LordQuack@74-141-215-186.dhcp.insightbb.com PRIVMSG #pircbotx :?stop
  40. 19:25:53.536 [listenerPool0-thread1] INFO org.pircbotx.output.OutputRaw - QUIT :
  41. 19:25:53.740 [main] INFO org.pircbotx.InputParser - :PircBotX-Reconne!~PircBotX@74-141-215-186.dhcp.insightbb.com QUIT :Client Quit
  42. 19:25:53.741 [main] INFO org.pircbotx.InputParser - ERROR :Closing Link: 74-141-215-186.dhcp.insightbb.com (Client Quit)
  43. 19:25:53.742 [main] INFO org.pircbotx.dcc.DccHandler - Terminating all transfers waiting to be accepted
  44. 19:25:53.742 [main] DEBUG org.pircbotx.PircBotX - Disconnected.
  45. 19:25:53.742 [main] DEBUG o.p.h.m.ThreadedListenerManager - Waiting for listener org.pircbotx.impl.PircBotXJoergModeExample@3490b317 to execute event MessageEvent(channel=Channel(name=#pircbotx, channelId=a9e07b4b-c17c-4b2b-b647-b03202c60fd9, dao=org.pircbotx.UserChannelDao@29b7458a, bot=Version{PircBotX 2.0-SNAPSHOT, a fork of PircBot, the Java IRC bot - pircbotx.googlecode.com} Connected{false} Server{irc.freenode.net} Port{6667} Password{null}, output=org.pircbotx.Channel$1@72bbffd, mode=, topic=Official PircBotX Test Channel | http://pircbotx.googlecode.com/ | ?help to use TheLQ-PircBotX example bot, topicTimestamp=1365448714000, createTimestamp=0, topicSetter=TheLQ, moderated=false, noExternalMessages=false, inviteOnly=false, secret=false, channelPrivate=false, topicProtection=false, channelLimit=-1, channelKey=null, modeStale=false, modeLatch=null), user=User(bot=Version{PircBotX 2.0-SNAPSHOT, a fork of PircBot, the Java IRC bot - pircbotx.googlecode.com} Connected{false} Server{irc.freenode.net} Port{6667} Password{null}, dao=org.pircbotx.UserChannelDao@29b7458a, userId=66173163-27bc-41f2-a15f-3cee677f4d45, output=org.pircbotx.User$1@92b63f6, nick=TheLQ, realName=, login=, hostmask=, away=false, ircop=false, server=, hops=0), message=?stop)
  46. 19:25:54.537 [main] DEBUG o.p.h.m.ThreadedListenerManager - Waiting for listener org.pircbotx.hooks.CoreHooks@69a87caa to execute event DisconnectEvent(daoSnapshot=org.pircbotx.snapshot.UserChannelDaoSnapshot@7fafb02d)
  47. 19:25:54.537 [main] INFO org.pircbotx.PircBotX - Shutdown has been called, closing InputParser
  48. ------------------------------------------------------------------------
  49. BUILD SUCCESS
  50. ------------------------------------------------------------------------
  51. Total time: 1:47.731s
  52. Finished at: Wed Jul 24 19:25:54 EDT 2013
  53. Final Memory: 28M/382M
  54. ------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement