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).

!7

sS denkmodulID = #1013938;
sO denkmodul;

static long timeout = 60000;
static int interval = 50;
static double codeUpdateInterval = 60.0;
sS listName = "Katze Speech Recognition Log With Date";
sS outListName = "Katze | Things the phone should say";

p {
  doEvery(100, f update);
  temp tempSetTL(autoRestartModule_checkInterval, codeUpdateInterval);
  runInMCVarWithAutoRestart('denkmodul, denkmodulID);
}

static int lastLength = -1;
  
svoid update {
  S data = mL_onServer_rawListText_opt(listName);
  if (lastLength < 0) lastLength = l(data);
  if (l(data) > lastLength) {
    S newStuff = substring(data, lastLength);
    lastLength = l(data);
    L<S> inputLines = map dropLeadingSquareBracketStuff(whereLeadingSquareBracketStuffContains("phone", nempties(lines(newStuff))));
    print("Cat Thinking");
    new L<S> out;
    for (S s : inputLines) {
      S a = "";
      printIndent(s);
      pcall { a = callAnswerFunction(denkmodul, s); }
      if (nempty(a)) {
        out.add(a);
        printIndent(" >> " + a);
      }
    }
    appendToMechList(outListName, out);
  }
}

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: 398 / 2428
Version history: 11 change(s)
Referenced in: [show references]