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)

svoid sfBot_p {
  setConsoleInputIfEmpty("sf");
  callStaticAnswerMethod("sf");
  if (!headless()) swing {
    JButton btn;
    showControls(jcenteredLine(btn = jbutton("Add new standard function", r-thread { sfBot_doIt() })));
    btn.requestFocus();
  }
}

static S sfBot_answer(S s) {
  new Matches m;
  
  if "car"
    ret carBot_addStandardFunction();

  if "car *" {
    S id = m.unq(0);
    if (l(id) == 4) id = "102" + id;
    carBot_addStandardFunction(id);
    ret "OK";
  }
  
  if "synonym * *|syn * *"
    ret makeSFSynonym($1, $2);
  
  if "sf *" {
    S id = m.unq(0);
    if (l(id) == 4) id = "103" + id;
    addStdFunctionWithAnimation(id);
    ret "OK";
  }
  
  if "sc *" {
    S id = m.unq(0);
    if (l(id) == 4) id = "103" + id;
    addStdClassWithAnimation(id);
    ret "OK";
  }
  
  if "sf" {
    sfBot_doIt();
    ret "OK";
  }
  
  if "sc" {
    addStdClassWithAnimation();
    ret "OK";
  }
  
  if "rev *|swap *"
    ret sf_addReversedArguments($1);
    
  if "final *"
    ret sf_makeArgumentsFinal($1);
  
  null;
}

svoid sfBot_doIt() {
  addStdFunctionWithAnimation();
}

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: 588 / 898
Version history: 26 change(s)
Referenced in: #1003202 - Stefan's Assistant
#1006654 - Standard functions list 2 (LIVE, continuation of #761)