!7 sclass Katze extends DynModule { transient O catModule; JComponent visualize() { ret centerAndSouth( jimage(#1101205), vstack2( withMargin(jcenteredbutton("Start Listening", rThread startListening)), jcenteredbutton("Stop Listening", rThread stopListening) )); } void loadCat { if (catModule == null && !hasBot("Chrome Speech.")) ret true with catModule = runDependent(#1013936); false; } void listenJustOnce { print('listenJustOnce); temp enter(); loadCat(); send("Chrome Speech.", "just once"); } void startListening { print('startListening); temp enter(); if (!loadCat()) send("Chrome Speech.", "start recognition"); } void stopListening { temp enter(); sendOpt("Chrome Speech.", "stop recognition"); } start { onSpeechRecognized(voidfunc(S s) { temp enter(); //callOpt(dm_moduleOfType('Hello), 'setText, s); if (!match("stop listening", s)) dm_setAIBarText(s); }); } void cleanMeUp_katze { cleanUp(catModule); catModule = null; } }