Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

42
LINES

< > BotCompany Repo | #1002676 // IRC Log Bot (dev., abandoned)

JavaX source code [tags: archive] - run with: x30.jar

!752

!1002672 // pircbot library

import org.jibble.pircbot.*;

static S server = "irc.freenode.net";
static S channel = "##linux";
static S name = "Cumulate";

p {
  new MyBot bot;
  bot.setVerbose(true);
  bot.connect(server);
  bot.joinChannel(channel);
}

static class MyBot extends PircBot {
  MyBot() {
    setName(name);
    setAutoNickChange(true);
  }
  
  public void onMessage(String channel, String sender,
                        String login, String hostname, String message) {
    logMap(channel + ".log", litmap("type", "public", "channel", channel, "sender", sender, "login", login, "hostname", hostname, "msg", message);
  }
  
  public void onPrivateMessage(String sender,
                               String login,
                               String hostname,
                               String message) {
    logMap(channel + ".log", litmap("type", "private", "sender", sender, "login", login, "hostname", hostname, "msg", message);
 }
 
  public void onNotice(String sourceNick,
                        String sourceLogin,
                        String sourceHostname,
                        String target,
                        String notice) {
    logMap(channel + ".log", litmap("type", "notice", "sourceNick", sourceNick, "sourceLogin", sourceLogin, "sourceHostname", sourceHostname, "target", target, "notice", notice);
 }
}

Author comment

Began life as a copy of #1002674

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002676
Snippet name: IRC Log Bot (dev., abandoned)
Eternal ID of this version: #1002676/1
Text MD5: c9ec664546af1e7766357022928eb1da
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-12 20:49:34
Source code size: 1404 bytes / 42 lines
Pitched / IR pitched: No / No
Views / Downloads: 625 / 555
Referenced in: [show references]