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

22
LINES

< > BotCompany Repo | #1005881 // tunnelToAI1Bot - send signed request to bot on ai1.lol

JavaX fragment (include)

1  
static S tunnelToAI1Bot(S botID, S text) {
2  
  ret tunnelToAI1Bot(format3("please forward to bot *: *", botID, text));
3  
}
4  
  
5  
static S tunnelToAI1Bot(S text) {
6  
  S signed = signWithComputerID(text);
7  
  //print(signed);
8  
  //print("OK? " + isSignedWithKey(signed, masterKey));
9  
  
10  
  DialogIO io = talkTo("ai1.lol", 4999);
11  
  try {
12  
    S greeting = io.readLine();
13  
    S line = format3("signed: *", signed);
14  
    print (">> " + line);
15  
    io.sendLine(line);
16  
    S answer = io.readLine();
17  
    print ("<< " + answer);
18  
    ret answer;
19  
  } finally {
20  
    io.close();
21  
  }
22  
}

Author comment

Began life as a copy of #1001593

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005881
Snippet name: tunnelToAI1Bot - send signed request to bot on ai1.lol
Eternal ID of this version: #1005881/1
Text MD5: ca4a2753af31054e9a926d9741566585
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-12 13:29:07
Source code size: 576 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 391 / 431
Referenced in: [show references]