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).

!752

!include #1002268 // Slack Bot
!include #1002578 // Eleu Core just to satisfy dependencies of above

static boolean actuallyPost = true;
static S botUserName = "eleu_learns_to_think";
static S actualBotUserName = "eleu"; // token user name

static Channel channel;

p {
  initSlackBot(); // makes the channel list, but doesn't start any loop
  channel = channels.get(0); // #talkingbots
  
  //channel.postAnswer("I am a puppet!");
  
  print("Please type \"say [bla]\" to make her say things.");
  Android3 android = new Android3("Eleu Sock Puppet Control");
  android.responder = makeResponder(new O() {
    S answer(S s) {
      Lisp tree = nlParse(s);
      new HashMap<S, Lisp> m;
      if (nlMatch("say $x", tree, m)) {
        S line = nlUnparse(m.get("x"));
        line += " [he made me say that!]";
        channel.postAnswer(line);
        ret "OK, posted!";
      }
      ret null;
    }
  });
  makeBot(android);
}

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: 507 / 518
Referenced in: #3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)