Share Pastebin
Guest
Public paste!

zumbrunn

By: a guest | Jan 21st, 2008 | Syntax: None | Size: 1.01 KB | Hits: 597 | Expires: Never
Copy text to clipboard
  1.  
  2. function startHopbot() {
  3.     var logdir = new java.io.File('./hopbotlog');
  4.     logdir.mkdirs();
  5.     if (logdir.isDirectory()) {
  6.         var server = "irc.freenode.net";
  7.         var channel = "#helma";
  8.         var nick = "hopbot";
  9.         var passwd = 'xxxxxxx';  // change password
  10.         var joinMessage = "This channel is logged: http://helma.zumbrunn.com/hopbot/";
  11.        
  12.         global.hopbot = new Packages.org.jibble.logbot.LogBot(nick, logdir, joinMessage);
  13.         global.hopbot.connect(server);
  14.         global.hopbot.joinChannel(channel);
  15.         global.hopbot.sendMessage('NickServ','IDENTIFY '+ passwd);
  16.         global.hopbot.sendMessage('ChanServ','OP #helma');
  17.         global.hopbot.setTopic(channel,'Just ask your question :-) and paste code at http://helma.pastebin.com/ - visit http://helma.zumbrunn.com/hopbot/ for channel logs.');
  18.     }
  19.     else
  20.         global.hopbot = "Couldn't create log directory";
  21. }
  22.  
  23. if (!global.hopbot) {
  24.     defineLibraryScope('hopbot');
  25.     startHopbot();
  26. }