static int newFindBot_botVM; static synchronized DialogIO newFindBot(S name) { if (newFindBot_botVM == 0) { print("Looking for Bot VM."); L botVMs = quickBotScan("This is a JavaX VM. Bot VM."); if (!botVMs.isEmpty()) { newFindBot_botVM = botVMs.get(0).port; print("Bot VM is at port " + newFindBot_botVM + "."); } } if (newFindBot_botVM != 0) { DialogIO io = talkTo(newFindBot_botVM); S q = format("has bot *", name); S s = io.ask(q); //print(format("Answer of Bot VM to *: *", q, s)); if (match("yes", s)) { io = talkToSubBot(name, io); call(io, "pushback", "?"); // put some hello string in (yes, this should be improved.) ret io; } } ret findBot(name); }