!747 m { static new Map lastSeen; // computer ID to timestamp p { readLocally("lastSeen"); makeAndroid3("Who Is Online Bot."); } static synchronized S answer(S s) { new Matches m; if (match3("I am online. -*", s, m)) { S computerID = m.unq(0); lastSeen.put(computerID, now()); saveLocally("lastSeen"); print("Got ping from " + computerID + "."); ret "OK, noted."; } if (match3("When was * last online?", s, m)) { Long time = lastSeen.get(m.unq(0)); ret time != null ? format3("at *", time) : "never"; } ret standardQuery(s, "lastSeen"); } }