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

!7

set flag DynModule.

sclass SFCat > DynPrintLog {
  transient BakedBot bot;
  transient S imageID = #1101382;
  S rulesList = "Computer Rules";
  
  start {
     ownResource(vmBus_onMessage('remoteMechListMirrorChanged, voidfunc(S listName) {
      print("Got list change: " + listName);
      if (eqic(listName, rulesList))
        bot.setRules(mL_raw(rulesList));
    }));
    actuallyLoadCat();
    print("Number of rules: " + call(bot.factsBot(), 'numRules));
    onSpeechRecognized(voidfunc(S s) { dm_say(bot.answer(s)); });
  }
  
  void setIcon(S imageID) {
    this.imageID = imageID;
    revisualize();
  }
  
  JComponent centerPart() { ret withMargin(10, jimage(imageID)); }
  
  void actuallyLoadCat {
    dm_useLocalMechListCopies();
    if (bot == null) {
      S rules = mL_raw(rulesList);
      printIndent("RULES | ", rules);
      bot = latestBotWithRulesAndCreator(rules, this);
    }
  }
}

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