!7 cmodule SmartHomeDemo > DynPrintLogAndEnabled { start { dm_onUserUtterance(s -> { S answer = webBot_answer(s, #1026867); LS tok = javaTokWithBrackets(answer); for (int i = 1; i < l(tok); i += 2) if (eqGet(tok, i, "#") && isCurlyBracketed(get(tok, i+2))) { S cmd = uncurly(get(tok, i+2)); print("Have cmd: " + cmd); runCmd(cmd); clearTokens(tok, i, i+3); } dm_say(trimJoin(tok)); }); } // API void runCmd(S cmd) { LS tok = javaTok(cmd); if (jmatch2("=", tok)) dm_mqtt_send(firstToken(tok), lastToken(tok)); } }