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

62
LINES

< > BotCompany Repo | #1002596 // System Name + URLs Bot

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1716L/11K/37K).

!752

static volatile S name = "A-yet-unnamed-copy-of-Eleutheria";
static volatile S url, baseURL; // baseURL is the one that bots are under

p {
  load("name");
  load("url");
  load("baseURL");
}

synchronized answer {
  if "what is your name"
    ret name;
  if "what is your url"
    ret url;
  if "what is your base url"
    ret baseURL;
  if "your name is *" {
    S n = m.unq(0);
    if (eq(n, name))
      ret "Yes.";
    else if (webAuthed()) {
      name = n;
      save("name");
      ret format("OK, master! I am now *", name);
    } else
      ret "Only my master can tell me that...";
  }
  
  if "your url is *"
    if (webAuthed()) {
      if (!isURL(m.unq(0)))
        ret "woot, master?";
        
      url = m.unq(0);
      save("url");
      ret "OK";
    }
    
  if "your base url is *"
    if (webAuthed()) {
      if (!isURL(m.unq(0)))
        ret "woot, master?";
        
      baseURL = m.unq(0);
      save("baseURL");
      ret "OK";
    }
}

static S getName() {
  ret name;
}

static S getURL() {
  ret url;
}

static S getBaseURL() {
  ret baseURL;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002596
Snippet name: System Name + URLs Bot
Eternal ID of this version: #1002596/1
Text MD5: 354a56fd15d9f04a32051f35b8f13624
Transpilation MD5: 4ce1bca29330ba98fc24b691fea64c80
Author: stefan
Category: eleu
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-03-14 17:20:06
Source code size: 1144 bytes / 62 lines
Pitched / IR pitched: No / No
Views / Downloads: 648 / 1731
Referenced in: #1002597 - system - return name of system (e.g. "Eleutheria")
#1002625 - systemURL - return URL of system if set
#1002626 - Sister Bot
#1002642 - mainURL
#3000201 - Answer for stefanreich (>> list all files)
#3000202 - Answer for stefanreich (>> T conversion bot)
#3000203 - Answer for stefanreich (>> timing hello bot)
#3000208 - Answer for bgrgndz (>> list sub bots)
#3000209 - Answer for bgrgndz (>> list sub bots)
#3000238 - Answer for stefanreich (>> t power bot)
#3000369 - Answer for Stefan (>> list sub bots)
#3000376 - Answer for stefanreich (>> list sub bots)
#3000377 - Answer for stefanreich (>> timing eleu?)
#3000380 - Answer for stefanreich (>> list sub bots)
#3000381 - Answer for speedforce (>> list sub bots)
#3000382 - Answer for ferdie (>> t = 1, f = 0)