!7 cmodule CurrentTimeDialog > DynSayAndInputBot { class TimeBot extends AbstractSayAndInputBot2 implements Runnable { MatchAttractor thanks = new("thanks|thank you|thx", r { say("You're welcome") }); MatchAttractor whatCanYouDo = new("what can you do...|what is your skill|who are you", r { say("I can tell you the time"); addAttractor(doIt); }); MatchAttractor doIt = new("do it|ok|i want that", r sayTime); MatchAttractor talkToMe = new("talk to me|hi|talk|say something", r run_public); MatchAttractor doItAgain = new("do it again|again|another time", r sayTime); MatchAttractor whatsTheTime = new("what's the time|tell me the time|time", r sayTime); Attractor yes_SayTime = new(f isYes_1, r sayTime); Attractor sayOK = new(f1_true(), r { say("OK") }); *() { addPreprocessors(f ai_dropLeadingAndTrailingAppellations_sortedByLength); standardAttractors(doItAgain, whatsTheTime, talkToMe, whatCanYouDo, thanks); } public void run { say("Do you want to know the current time?"); addAttractor(yes_SayTime); addLowPrioAttractor(sayOK); } void sayTime { say("It is " + localTime_24()); } } TimeBot makeBot() { ret new TimeBot; } }