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

29
LINES

< > BotCompany Repo | #1017667 // Telegram Initiative Bot [Dyn Module, not used anymore]

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

Uses 408K of libraries. Compilation Failed (22290L/167K).

!7

set flag DynModule.

sclass TelegramInitiativeBot > AbstractTelegramThinkBot {
  new L<Pair<S, IfThen>> activeTempRules;
  
  void thinkAbout(S s) {
    if (eq(s, "!initiative")) {
      L<IfThen> rules = mL_parsedNLRulesWithoutIDs("Initiative rules");
      for (IfThen rule : shuffledIterator(rules)) {
        Pair<Exp> p = nlLogic_extractFirstCondition(rule.in);
        if (p == null) continue;
        if (nlLogic_isFunc(p.a, 'initiative)) {
          postMessage(nlLogic_text(((Func) p.a).arg));
          IfThen temp = IfThen(p.b, rule.out);
          print("Have temp rule: " + sfu(temp));
          activeTempRules.add(pair(aGlobalID(), temp));
          ret;
        }
      }
    }
    
    applyNLLogicFacts_v3(s, voidfunc(Exp e) {
      if (e cast Func) if (eq(e.name, 'output)) postMessage(e.arg.text()) },
      activeTempRules);
    activeTempRules.clear();
  }
}

Author comment

Began life as a copy of #1017593

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017667
Snippet name: Telegram Initiative Bot [Dyn Module, not used anymore]
Eternal ID of this version: #1017667/7
Text MD5: 8f88800194fab23a0c7dded63f134cb1
Transpilation MD5: 734df3e4ce6026bb3d8ccad602391093
Author: stefan
Category: javax / telegram
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-20 19:46:37
Source code size: 912 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 298 / 7284
Version history: 6 change(s)
Referenced in: [show references]