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

46
LINES

< > BotCompany Repo | #1001345 // Channel Bridge Bot (developing)

JavaX source code - run with: x30.jar

!747

m {
  static new Map<S, Channel> channels;
  
  static class Channel {
    S id, S pw;
    S computer1, computer2;
    //new L<S> computersLoggedIn;
  }
  
  p {
    makeAndroid3("Channel Bridge Bot.");
  }
  
  static synchronized S answer(S s, L<S> history) {
    Channel c = getChannel(id);
    S computerID = getComputerID(history);
    
    if (match3("this is computer *", s))
      return "ok";
      
    if (match3("please send: "))
      TODO
      
    return null;
  }
  
  static S getComputerID(L<S> history) {
    new Matches m;
    for (S s : history)
      if (match3("this is computer *", s, m))
        return unquote(m.m[0]);
    return null;
  }
  
  static Channel getChannel(S id) {
    Channel c = channels.get(id);
    if (c == null) {
      c = new Channel;
      c.id = id;
      channels.put(id, c);
    }
    return c;
  }
}

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: #1001345
Snippet name: Channel Bridge Bot (developing)
Eternal ID of this version: #1001345/1
Text MD5: 9bb8fa123b81bae660de65a8af01ddee
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-10 19:15:00
Source code size: 904 bytes / 46 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 607 / 528
Referenced in: [show references]