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

34
LINES

< > BotCompany Repo | #1002891 // Eleu Sock Puppet Test

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

Libraryless. Click here for Pure Java version (5483L/39K/121K).

1  
!752
2  
3  
!include #1002268 // Slack Bot
4  
!include #1002578 // Eleu Core just to satisfy dependencies of above
5  
6  
static boolean actuallyPost = true;
7  
static S botUserName = "eleu_learns_to_think";
8  
static S actualBotUserName = "eleu"; // token user name
9  
10  
static Channel channel;
11  
12  
p {
13  
  initSlackBot(); // makes the channel list, but doesn't start any loop
14  
  channel = channels.get(0); // #talkingbots
15  
  
16  
  //channel.postAnswer("I am a puppet!");
17  
  
18  
  print("Please type \"say [bla]\" to make her say things.");
19  
  Android3 android = new Android3("Eleu Sock Puppet Control");
20  
  android.responder = makeResponder(new O() {
21  
    S answer(S s) {
22  
      Lisp tree = nlParse(s);
23  
      new HashMap<S, Lisp> m;
24  
      if (nlMatch("say $x", tree, m)) {
25  
        S line = nlUnparse(m.get("x"));
26  
        line += " [he made me say that!]";
27  
        channel.postAnswer(line);
28  
        ret "OK, posted!";
29  
      }
30  
      ret null;
31  
    }
32  
  });
33  
  makeBot(android);
34  
}

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: #1002891
Snippet name: Eleu Sock Puppet Test
Eternal ID of this version: #1002891/1
Text MD5: 591f4b467e729493c7e5746ef7166217
Transpilation MD5: b89aa2de3fe17bc152a3ad12de5f83d9
Author: stefan
Category: eleu / nl
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-03-26 21:29:41
Source code size: 968 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 461 / 457
Referenced in: [show references]