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

39
LINES

< > BotCompany Repo | #1001133 // Information forwarding android (developing)

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

Libraryless. Click here for Pure Java version (1228L/9K/29K).

1  
// todo: actual upload
2  
3  
!747
4  
5  
m {
6  
  static new L<Info> informationForServer;
7  
  static new L<Info> forwarded;
8  
  
9  
  static class Info {
10  
    S text;
11  
    long timeSubmitted, timeForwarded;
12  
    
13  
    *() {}
14  
    *(S *text, long *timeSubmitted) {}
15  
  }
16  
  
17  
  p {
18  
    readLocally("informationForServer forwarded");
19  
    makeAndroid("Information forwarding android.", stringfunc { answer(s) });
20  
  }
21  
  
22  
  static synchronized S answer(S s) {
23  
    new Matches m;
24  
    
25  
    if (match3("Can you forward information to the main server?", s))
26  
      return "yes";
27  
    if (match3("please forward to main server: ...", s, m)) {
28  
      informationForServer.add(new Info(m.m[0], now()));
29  
      saveLocally("informationForServer");
30  
      return "ok, forwarding: " + quote(m.m[0]);
31  
    }
32  
    if (match3("how many lines are in store?", s))
33  
      return "" + informationForServer.size();
34  
    if (match3("show me your store", s))
35  
      return structure(informationForServer);
36  
    
37  
    return null;
38  
  }
39  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001133
Snippet name: Information forwarding android (developing)
Eternal ID of this version: #1001133/1
Text MD5: f1a1de29fd29b4d71e259c184b8e6860
Transpilation MD5: ae752efc0c0f1554ce8307e5f5018b4a
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-23 21:29:15
Source code size: 1008 bytes / 39 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 572 / 917
Referenced in: [show references]