!7 static Map cmdToProgram; p { cmdToProgram = persistentTreeMap("Command to program"); makeBot("Voice Actions."); } sS answer(S s) { new Matches m; if "user said: *" s = $1; S a; try { a = answer2(s); } catch e { printStackTrace(e); a = str(e); } infoBox_lower(a); ret a; } sS answer2(S s) { new Matches m; if "command * to program *" { cmdToProgram.put($1, $2); ret "OK"; } if "applause" { applause(); ret "Applause!"; } if "restart voice actions" { restartIn1(); ret "OK"; } S program = lookupByNLMatch(cmdToProgram, s); if (nempty(program)) { nohupJavax(program); ret "Running: " + snippetWithTitle(program); } null; }