!7 static long attnTimeout = 60000; sS reKatze = "Katze|Katze|Katja|Qatar|Cookson|Captain|Cat|Kettle|Cut|Kurt"; static JTextArea ta; static IVar text; static Class recognizer; static long attention; p-subst { recognizer = hotwire(#1009816); text = persistentVar("Text"); ta = bindTextAreaToVar(text, jwordwraptextarea()); showFrame(fontSize(20, ta)); moveCaretToEnd(ta); set(recognizer, onUtterance := voidfunc(S utterance) { if (match("turn off", utterance)) call(recognizer, 'stopRecognition); appendToTextAreaAndMoveCaret(ta, utterance + "\n"); callAnswerMethodVerbose(utterance); }); //set(recognizer, startRecognition := true); callMain(recognizer); } sS answer(fS s) { if (sysNow() >= attention+attnTimeout) attention = 0; if (attention != 0) { if "nichts|nix|vergiss es|nothing|forget it" { playWAVSnippet(#1013870); } thread { playRandomSoundFromFreesoundOrg(s); } attention = 0; print("attn off"); } if (regexpICFind(reKatze, s)) { if (isShit(s)) playMP3Snippet(#1013884); else playWAVSnippet(#1013870); attention = sysNow(); print("attn"); ret "Yo"; } L g = regexpGetGroups("(-?\\d+) x (-?\\d+)$", s); if (g != null) ret gudrun(str(parseLong(first(g))*parseLong(second(g)))); null; } sbool isShit(S s) { ret regexpICFind("scheiß", s); }