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

1  
!752
2  
!1002672 // pircbot library
3  
4  
import org.jibble.pircbot.*;
5  
6  
static S server = "irc.freenode.net";
7  
static S channel = "##linux";
8  
static S name = "Cumulate";
9  
10  
p {
11  
  new MyBot bot;
12  
  bot.setVerbose(true);
13  
  bot.connect(server);
14  
  bot.joinChannel(channel);
15  
}
16  
17  
static class MyBot extends PircBot {
18  
  MyBot() {
19  
    setName(name);
20  
    setAutoNickChange(true);
21  
  }
22  
  
23  
  public void onMessage(String channel, String sender,
24  
                        String login, String hostname, String message) {
25  
    logMap(channel + ".log", litmap("type", "public", "channel", channel, "sender", sender, "login", login, "hostname", hostname, "msg", message);
26  
  }
27  
  
28  
  public void onPrivateMessage(String sender,
29  
                               String login,
30  
                               String hostname,
31  
                               String message) {
32  
    logMap(channel + ".log", litmap("type", "private", "sender", sender, "login", login, "hostname", hostname, "msg", message);
33  
 }
34  
 
35  
  public void onNotice(String sourceNick,
36  
                        String sourceLogin,
37  
                        String sourceHostname,
38  
                        String target,
39  
                        String notice) {
40  
    logMap(channel + ".log", litmap("type", "notice", "sourceNick", sourceNick, "sourceLogin", sourceLogin, "sourceHostname", sourceHostname, "target", target, "notice", notice);
41  
 }
42  
}

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: 628 / 559
Referenced in: [show references]