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

1  
!7
2  
3  
set flag DynModule.
4  
5  
sclass TelegramInitiativeBot > AbstractTelegramThinkBot {
6  
  new L<Pair<S, IfThen>> activeTempRules;
7  
  
8  
  void thinkAbout(S s) {
9  
    if (eq(s, "!initiative")) {
10  
      L<IfThen> rules = mL_parsedNLRulesWithoutIDs("Initiative rules");
11  
      for (IfThen rule : shuffledIterator(rules)) {
12  
        Pair<Exp> p = nlLogic_extractFirstCondition(rule.in);
13  
        if (p == null) continue;
14  
        if (nlLogic_isFunc(p.a, 'initiative)) {
15  
          postMessage(nlLogic_text(((Func) p.a).arg));
16  
          IfThen temp = IfThen(p.b, rule.out);
17  
          print("Have temp rule: " + sfu(temp));
18  
          activeTempRules.add(pair(aGlobalID(), temp));
19  
          ret;
20  
        }
21  
      }
22  
    }
23  
    
24  
    applyNLLogicFacts_v3(s, voidfunc(Exp e) {
25  
      if (e cast Func) if (eq(e.name, 'output)) postMessage(e.arg.text()) },
26  
      activeTempRules);
27  
    activeTempRules.clear();
28  
  }
29  
}

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: 358 / 7373
Version history: 6 change(s)
Referenced in: [show references]