Libraryless. Click here for Pure Java version (2904L/19K/66K).
1 | !752 |
2 | |
3 | p { |
4 | Android3 a = new Android3("Public Comm Bot at " + getComputerID() + "."); |
5 | a.publicOverride = true; |
6 | a.useMultiPort = false; |
7 | a.startPort = 4999; |
8 | a.console = false; |
9 | makeAndroid(a); |
10 | if (a.port != a.startPort) { |
11 | print("Could not register port " + a.startPort + ", disposing."); |
12 | a.dispose(); |
13 | } |
14 | } |
15 | |
16 | static S answer(S s) { |
17 | new Matches m; |
18 | |
19 | if (match3("test", s)) |
20 | return "test!"; |
21 | |
22 | if (match3("please forward to bot *: *", s, m)) { |
23 | S bot = unquote(m.m[0]); |
24 | S line = unquote(m.m[1]); |
25 | ret forwardTo(bot, line); |
26 | } |
27 | |
28 | null; |
29 | } |
30 | |
31 | static S forwardTo(S bot, S line) { |
32 | /*S id = autoStartable.get(bot); |
33 | if (id != null) |
34 | startBot(bot, id);*/ |
35 | ret sendToLocalBotOpt(bot, line); |
36 | } |
Began life as a copy of #1001248
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, crvwmplrxojx, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, nbgitpuheiab, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004080 |
Snippet name: | Simple Public Comm Bot for phone - assumes phone is on private IP |
Eternal ID of this version: | #1004080/1 |
Text MD5: | 88e8584383e82e19f75b1221dd07b0bf |
Transpilation MD5: | dc9099df12f38664cb6ac840ecc1da1f |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-08-07 17:52:53 |
Source code size: | 765 bytes / 36 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 483 / 590 |
Referenced in: | [show references] |