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

36
LINES

< > BotCompany Repo | #1004080 // Simple Public Comm Bot for phone - assumes phone is on private IP

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

Libraryless. Click here for Pure Java version (2904L/19K/66K).

!752

p {
  Android3 a = new Android3("Public Comm Bot at " + getComputerID() + ".");
  a.publicOverride = true;
  a.useMultiPort = false;
  a.startPort = 4999;
  a.console = false;
  makeAndroid(a);
  if (a.port != a.startPort) {
    print("Could not register port " + a.startPort + ", disposing.");
    a.dispose();
  }
}

static S answer(S s) {
  new Matches m;
  
  if (match3("test", s))
    return "test!";
    
  if (match3("please forward to bot *: *", s, m)) {
    S bot = unquote(m.m[0]);
    S line = unquote(m.m[1]);
    ret forwardTo(bot, line);
  }
  
  null;
}

static S forwardTo(S bot, S line) {
  /*S id = autoStartable.get(bot);
  if (id != null)
    startBot(bot, id);*/
  ret sendToLocalBotOpt(bot, line);
}

Author comment

Began life as a copy of #1001248

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004080
Snippet name: Simple Public Comm Bot for phone - assumes phone is on private IP
Eternal ID of this version: #1004080/1
Text MD5: 88e8584383e82e19f75b1221dd07b0bf
Transpilation MD5: dc9099df12f38664cb6ac840ecc1da1f
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-07 17:52:53
Source code size: 765 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 417 / 503
Referenced in: [show references]