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