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

30
LINES

< > BotCompany Repo | #1001258 // OK Sender Bot (does nothing but send OKs to server if you type "ok")

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

Libraryless. Click here for Pure Java version (1123L/8K/26K).

!747

m {
  p {
    makeAndroid3("OK Sender Bot.");
  }
  
  static synchronized S answer(S s, L<S> history) {
    if (match3("ok", s)) {
      final L<S> _history = new ArrayList<S>(history);
      thread {
        print("[server response to ok submit] " + sendOK(_history));
      }
      ret ":) Will forward to server (with history)!";
    }
    ret null;
  }
  
  static S sendOK(L<S> history) {
    S userLine = history.get(history.size()-1);
    S user = "?";
    S botID = getProgramID();
    S computerID = getComputerID();
    long date = now();
    
    S line = format3("New entry. user line: *, date: *, user: *, botID: *, computerID: *, dialog history: *",
      userLine, date, user, botID, computerID, history);
    return sendToRemoteBot("OK Collector Bot", line);
  }
}

Author comment

Began life as a copy of #1001257

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: #1001258
Snippet name: OK Sender Bot (does nothing but send OKs to server if you type "ok")
Eternal ID of this version: #1001258/1
Text MD5: c9640af75e8f8b666c89b4db7497f1c9
Transpilation MD5: e1425067e837d2c4bb6f0a11d61b71a2
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-05 18:00:12
Source code size: 816 bytes / 30 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 532 / 517
Referenced in: [show references]