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

40
LINES

< > BotCompany Repo | #1014925 // Cat Thought Bot (phone to phone)

JavaX source code (desktop) [tags: butter use-pretranspiled] - run with: x30.jar - homepage

Download Jar. Libraryless. Click here for Pure Java version (7491L/51K).

1  
!7
2  
3  
sS denkmodulID = #1013938;
4  
sO denkmodul;
5  
6  
static long timeout = 60000;
7  
static int interval = 50;
8  
static double codeUpdateInterval = 60.0;
9  
sS listName = "Katze Speech Recognition Log With Date";
10  
sS outListName = "Katze | Things the phone should say";
11  
12  
p {
13  
  doEvery(100, f update);
14  
  temp tempSetTL(autoRestartModule_checkInterval, codeUpdateInterval);
15  
  runInMCVarWithAutoRestart('denkmodul, denkmodulID);
16  
}
17  
18  
static int lastLength = -1;
19  
  
20  
svoid update {
21  
  S data = mL_onServer_rawListText_opt(listName);
22  
  if (lastLength < 0) lastLength = l(data);
23  
  if (l(data) > lastLength) {
24  
    S newStuff = substring(data, lastLength);
25  
    lastLength = l(data);
26  
    L<S> inputLines = map dropLeadingSquareBracketStuff(whereLeadingSquareBracketStuffContains("phone", nempties(lines(newStuff))));
27  
    print("Cat Thinking");
28  
    new L<S> out;
29  
    for (S s : inputLines) {
30  
      S a = "";
31  
      printIndent(s);
32  
      pcall { a = callAnswerFunction(denkmodul, s); }
33  
      if (nempty(a)) {
34  
        out.add(a);
35  
        printIndent(" >> " + a);
36  
      }
37  
    }
38  
    appendToMechList(outListName, out);
39  
  }
40  
}

Author comment

Began life as a copy of #1014866

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014925
Snippet name: Cat Thought Bot (phone to phone)
Eternal ID of this version: #1014925/12
Text MD5: eec0add3759324a97c196520a3fd2cc2
Transpilation MD5: 047e60c0885fc955cb1c5d851dac169e
Author: stefan
Category: javax / web / a.i. / android
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-20 23:58:46
Source code size: 1128 bytes / 40 lines
Pitched / IR pitched: No / No
Views / Downloads: 569 / 2792
Version history: 11 change(s)
Referenced in: [show references]