static Map phonePublicCommBot_clients = synchroHashMap(); sbool phonePublicCommBot_brave; // true = expose yourself on public IP static bool phonePublicCommBot() { if (eq("true", trim(readTextFile(getProgramFile("#1004118", "brave"))))) phonePublicCommBot_brave = true; if (doIHavePublicIPs()) { if (phonePublicCommBot_brave) print("NOTE: WE'RE BRAVE (PUBLIC IP)!!!!!!!"); else { print("JavaX Safety Note: We're on a public IP!! Not starting public comm bot."); false; } } Android3 a = new Android3("Public Comm Bot at " + getComputerID() + "."); a.publicOverride = true; a.useMultiPort = false; a.startPort = 4999; a.console = false; a.responder = makeResponder(new O { S answer(S s) { DialogIO io = makeAndroid3_io.get(); if (io != null) phonePublicCommBot_clients.put(io.getSocket().getInetAddress().getHostAddress(), now()); new Matches m; if "clients last seen" ret structure(phonePublicCommBot_clients); if "your ips" ret structure(getMyIPs()); if "test" return "test!"; if "ping" return "pong!"; if (match3("please forward to bot *: *", s, m)) { S bot = unquote(m.m[0]); S line = unquote(m.m[1]); ret sendToLocalBotOpt(bot, line); } if "please forward to vm: *" ret sendToThisVM($1); null; } }); makeAndroid(a); if (a.port != a.startPort) { //print("Could not register port " + a.startPort + ", disposing."); a.dispose(); false; } print("Public Comm Bot started."); true; }