Libraryless. Click here for Pure Java version (1412L/10K/33K).
!747 m { static new Map<S, Convo> convos; // mapped by dialog ID static class Convo { S dialogID; long date; L<S> lines; S botID; S computerID; } p { readLocally("convos"); print("Conversations in my database: " + convos.size()); makeAndroid("Conversations Log Bot."); } static synchronized S answer(S s) { new Matches m; if (match3("New dialog. dialog id: *. date: *. computer ID: *, bot ID: *. lines: *", s, m)) { new Convo x; x.dialogID = unquote(m.m[0]); x.date = parseLong(unquote(m.m[1])); x.computerID = unquote(m.m[2]); x.botID = unquote(m.m[3]); x.lines = (List) unstructure(unquote(m.m[4])); convos.put(x.dialogID, x); saveLocally("convos"); return "OK, now " + convos.size() + " conversations."; } if (match3("Add line to dialog. dialog id: *. line: *", s, m)) { S dialogID = unquote(m.m[0]); Convo x = convos.get(dialogID); if (x == null) return format3("Dialog not found: *", dialogID); x.lines.add(unquote(m.m[1])); return "OK, now " + x.lines.size() + " lines in conversation."; } return standardQuery(s, "convos"); } }
Began life as a copy of #1001245
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: | #1001307 |
Snippet name: | Conversations Logger Bot |
Eternal ID of this version: | #1001307/1 |
Text MD5: | 7e6e69ef378adafc5e204ed8736816f1 |
Transpilation MD5: | 3ab168d65d822554d9562d9acee9884d |
Author: | stefan |
Category: | |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-10-08 18:40:04 |
Source code size: | 1266 bytes / 46 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 612 / 871 |
Referenced in: | #1001299 - standardQuery, additionalQuery #3000202 - Answer for stefanreich (>> T conversion bot) #3000238 - Answer for stefanreich (>> t power bot) #3000382 - Answer for ferdie (>> t = 1, f = 0) #3000383 - Answer for funkoverflow (>> t=1, f=0 okay) |