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

36
LINES

< > BotCompany Repo | #1018558 // Standard Function Cat [Dyn Module, use #1018551 or #1019326 with this]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (21360L/113K).

1  
!7
2  
3  
set flag DynModule.
4  
5  
sclass SFCat > DynPrintLog {
6  
  transient BakedBot bot;
7  
  transient S imageID = #1101382;
8  
  S rulesList = "Computer Rules";
9  
  
10  
  start {
11  
     ownResource(vmBus_onMessage('remoteMechListMirrorChanged, voidfunc(S listName) {
12  
      print("Got list change: " + listName);
13  
      if (eqic(listName, rulesList))
14  
        bot.setRules(mL_raw(rulesList));
15  
    }));
16  
    actuallyLoadCat();
17  
    print("Number of rules: " + call(bot.factsBot(), 'numRules));
18  
    onSpeechRecognized(voidfunc(S s) { dm_say(bot.answer(s)); });
19  
  }
20  
  
21  
  void setIcon(S imageID) {
22  
    this.imageID = imageID;
23  
    revisualize();
24  
  }
25  
  
26  
  JComponent centerPart() { ret withMargin(10, jimage(imageID)); }
27  
  
28  
  void actuallyLoadCat {
29  
    dm_useLocalMechListCopies();
30  
    if (bot == null) {
31  
      S rules = mL_raw(rulesList);
32  
      printIndent("RULES | ", rules);
33  
      bot = latestBotWithRulesAndCreator(rules, this);
34  
    }
35  
  }
36  
}

Author comment

Began life as a copy of #1018412

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018558
Snippet name: Standard Function Cat [Dyn Module, use #1018551 or #1019326 with this]
Eternal ID of this version: #1018558/12
Text MD5: a1100ff6a6ff1355d67ce540658f935b
Transpilation MD5: 1d89c8026614a23b1922e89cb167f604
Author: stefan
Category: javax / speech
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-17 18:57:46
Source code size: 948 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 448 / 5329
Version history: 11 change(s)
Referenced in: [show references]