!7 !include once #1017126 // transpileRaw sclass RemoteControlled > DynPrintLog { S controllingComputers; bool enabled; visualize { ret centerAndSouthWithMargins(super.visualize(), vstackWithSpacing(jrightalignedline(dm_fieldCheckBox('enabled)), withLabel("Computers that can control me:", dm_fieldTextField('controllingComputers)))); } start { dm_requireModule("#1017119/OSChat"); watchQuotedLog_future(stefansOS_chat_receivedLogFile(), voidfunc(S msg) { pcall { LS computers = words2(controllingComputers); S author = getAuthorOfSignedText(msg); print("Author: " + author + ", controlling computers: " + computers); if (computers.contains(author)) { msg = trim(unsign(msg)); print("Got signed message from " + author + ": " + msg); new Matches m; if (swic_trim(msg, "eval NOW.", m)) { if (!enabled) print("Will not eval (module disabled)."); else { print("EVAL!"); printIndent(m.rest()); javaEval(m.rest()); } } } } }); } }