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

36
LINES

< > BotCompany Repo | #1001357 // Accept all incoming bots (seems a little brave ^^)

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

Libraryless. Click here for Pure Java version (1133L/8K/26K).

!747
!pcall {

m {
  static Class receivingBot;
  static int delay = 10000;
  
  p {
    while (true) {
      pcall { doIt(); }
      sleep(delay);
    }
  }
  
  static void doIt() {
    S answer = sendToRemoteBot("Identity Manager", format3("Who is moving to * (full state)", getComputerID()));
    print(answer);
    
    for (DynamicObject state : (L<DynamicObject>) unstructure(answer)) {
      print("State: " + structure(state));
      
      S botID = cast state.fieldValues.get("id");
      S dataID = cast state.fieldValues.get("dataID");
      
      if (receivingBot == null)
        receivingBot = hotwire("#1001337");
        
      answer = (S) call(receivingBot, "doIt", botID, dataID);
      print(answer);
      if (!match3("All done.", answer))
        continue;
        
      print(sendToRemoteBot("Identity Manager", format3("* is now in state *", botID, "residing")));
    }
  }
}

Author comment

Began life as a copy of #1001349

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001357
Snippet name: Accept all incoming bots (seems a little brave ^^)
Eternal ID of this version: #1001357/1
Text MD5: ecbbce42d9a9b0bef24b487b421e3bdb
Transpilation MD5: 182e03b1a930f34978f3e44377157ce9
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-13 16:56:41
Source code size: 938 bytes / 36 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 753 / 803
Referenced in: [show references]