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

62
LINES

< > BotCompany Repo | #1006590 // sfBot_p/sfBot_answer [standard functions/classes bot]

JavaX fragment (include)

1  
svoid sfBot_p {
2  
  setConsoleInputIfEmpty("sf");
3  
  callStaticAnswerMethod("sf");
4  
  if (!headless()) swing {
5  
    JButton btn;
6  
    showControls(jcenteredLine(btn = jbutton("Add new standard function", r-thread { sfBot_doIt() })));
7  
    btn.requestFocus();
8  
  }
9  
}
10  
11  
static S sfBot_answer(S s) {
12  
  new Matches m;
13  
  
14  
  if "car"
15  
    ret carBot_addStandardFunction();
16  
17  
  if "car *" {
18  
    S id = m.unq(0);
19  
    if (l(id) == 4) id = "102" + id;
20  
    carBot_addStandardFunction(id);
21  
    ret "OK";
22  
  }
23  
  
24  
  if "synonym * *|syn * *"
25  
    ret makeSFSynonym($1, $2);
26  
  
27  
  if "sf *" {
28  
    S id = m.unq(0);
29  
    if (l(id) == 4) id = "103" + id;
30  
    addStdFunctionWithAnimation(id);
31  
    ret "OK";
32  
  }
33  
  
34  
  if "sc *" {
35  
    S id = m.unq(0);
36  
    if (l(id) == 4) id = "103" + id;
37  
    addStdClassWithAnimation(id);
38  
    ret "OK";
39  
  }
40  
  
41  
  if "sf" {
42  
    sfBot_doIt();
43  
    ret "OK";
44  
  }
45  
  
46  
  if "sc" {
47  
    addStdClassWithAnimation();
48  
    ret "OK";
49  
  }
50  
  
51  
  if "rev *|swap *"
52  
    ret sf_addReversedArguments($1);
53  
    
54  
  if "final *"
55  
    ret sf_makeArgumentsFinal($1);
56  
  
57  
  null;
58  
}
59  
60  
svoid sfBot_doIt() {
61  
  addStdFunctionWithAnimation();
62  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006590
Snippet name: sfBot_p/sfBot_answer [standard functions/classes bot]
Eternal ID of this version: #1006590/27
Text MD5: 00156bfdd76f7fd32c58f5ddd86f0ad9
Author: stefan
Category: javax / internal
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-02 10:30:40
Source code size: 1164 bytes / 62 lines
Pitched / IR pitched: No / No
Views / Downloads: 590 / 902
Version history: 26 change(s)
Referenced in: [show references]