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

25
LINES

< > BotCompany Repo | #1001814 // Hit Log

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

Libraryless. Click here for Pure Java version (1907L/13K/42K).

!1001816 // a custom translator

m {
  static new MultiSet<S> hitsByIP;
  
  p {
    readLocally("hitsByIP");
    makeBot("Hit Log.");
  }
  
  static synchronized S answer(S s) {
    new Matches m;
    
    if (match3("note! a hit from ip *", s, m)) {
      hitsByIP.add(m.unq(0));
      saveLocally("hitsByIP");
      ret "OK, noted.";
    }
    
    if (match3("get hits from ip *", s, m))
      ret "" + hitsByIP.get(m.unq(0));
    
    ret null;
  }
}

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: #1001814
Snippet name: Hit Log
Eternal ID of this version: #1001814/1
Text MD5: 038706339fefa433cb4543063a550238
Transpilation MD5: ec57806027201676fb6a35ae3fcb611b
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-11-19 17:12:48
Source code size: 480 bytes / 25 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 580 / 625
Referenced in: [show references]