Warning: session_start(): open(/var/lib/php/sessions/sess_qjivhc20t9uafpn24d67hqoeu8, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!747
!pcall
m {
static S botID = "#1001756";
static S botName = "Get Selected Table Line Helper Bot";
static S cmd = "get selected table line as map";
p {
makeAndroid3("Get Selected Table Line Bot.");
}
static S answer(S s) {
if (match3("get selected table line as map", s)) {
new TreeMap results;
for (DialogIO vm : talkToAllOtherVMs()) {
pcall {
int vmPort = vm.getPort();
Map bots = (Map) safeUnstructure(vm.ask("list bots"));
print("VM " + vmPort + " bots: " + structure(bots));
if (!containsBot(bots, botName)) {
print("Injecting bot.");
injectTo(vmPort, botID);
int safetyCount = 0;
while (!containsBot((Map) safeUnstructure(vm.ask("list bots")), botName)) {
if (safetyCount >= 100) fail("bot did not start");
sleep(500);
}
}
S result = vm.ask("please forward to bot *: *", botName, cmd);
results.put(vmPort, result);
}
vm.close();
}
// include myself
Component focus = getFocusOwner();
if (focus instanceof JTable)
results.put(myVMPort(), structure(getSelectedLineAsMap((JTable) focus)));
Map result = getResult(results);
ret structure(result);
}
ret null;
}
static Map getResult(Map results) {
for (S s: results.values())
if (structIsMap(s))
ret (Map) unstructure(s);
ret null;
}
}