!7 static DynamicVStack stack; static O module; static S moduleID; static java.util.Timer moduleRestarter; p-subst { autoRestart(); defaultFrameIcon(#1101180); stack = dynamicVStack(); // spaces only between components showFrame(jscroll(withMargin(5, stack))); repeat with sleep 1 { updateModule(); L> l = (L) quickImport(callOpt(module, 'suggest)); if (l != null) { stack.clearComponents(); for (final Pair p : l) stack.addComponent(jMarginButton(p.a, r-thread { appendToMechList_noUniq_inQ("Suggested buttons clicked by user", now() + ": " + p.a); callF(p.b); })); } } } svoid updateModule { S moduleID = first(mL("Best suggester module")); if (neq(moduleID, main.moduleID)) { if (main.moduleID != null) infoBox("Switching to module " + moduleID); stopTimer(moduleRestarter); main.moduleID = moduleID; moduleRestarter = loadAndAutoRestartModule('module, moduleID); } }