!747 m { static S testProgram = "#1001200"; // get PATH variable static Class programClass; static S state; static Throwable exception; static DialogIO helper; p { makeAndroid("Program Runner Bot"); runProgram(testProgram); helper = findBot("Helper Bot"); print("Helper found: " + helper != null); } static class Defer { S id; S answer; *() { id = makeRandomID(6); defers.put(id, this); } public String toString() { return "Question deferred. ID: " + id; } } static new TreeMap defers; static synchronized S answer(S s) { new Matches m; if (match3("get deferred answer *", s, m)) { S id = unquote(m.m[0]); Defer d = defers.get(id); if (d != null) return d.answer != null ? d.answer : "No answer yet."; else return "Defer ID " + id + " not found..."; } if (helper != null) { new Defer defer; helper.sendLine("Please advise, defer id: " + defer.id + ", command: " + quote(s)); return defer.toString(); } return null; } static void state(S s) { state = s; print(s); } static synchronized void runProgram(S programID) { exception = null; state("Loading "+ programID); programClass = hotwire(programID); state("Calling main"); try { callMain(programClass); } catch (Throwable e) { exception = e; state("main done with exception"); } state("main done without exception"); } }