!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 { msg = trimSubstring(msg, indexOf(msg, " GMT")+4); 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 (matchStart(msg, " eval:", m)) { if (neqOneOf($1, "everyone", computerID())) print("Not for me."); else if (!enabled) print("Will not eval (module disabled)."); else { print("EVAL!"); printIndent(m.rest()); print(">> " + javaEval(m.rest())); } } } } }); } }