!7 cmodule CurrentTimeDialog > DynSayAndInputBot { class TimeBot extends AbstractSayAndInputBot2 implements Runnable { class Thanks > MatchAttractor { *() { super("thanks|thank you|thx"); } public void run { say("You're welcome"); } } class WhatCanYouDo > MatchAttractor { *() { super("what can you do...|what is your skill|who are you"); } public void run { say("I can tell you the time"); addAttractor(new DoIt); } } class DoIt > Attractor { public bool matches(S s) { ret matchX2("do it|ok|i want that", s); } public void run { sayTime(); } } class TalkToMe extends Attractor { public bool matches(S s) { ret matchX2("talk to me|hi|talk|say something", s); } public void run { 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, new TalkToMe, new WhatCanYouDo, new 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; } }