sclass AI_DatesBot > AttractorBot { Long now; public void run { say("I can resolve dates for you"); } // CONFIG class Attractor1 > Attractor { int month, day; public bool matches(S s) { new Matches m; if (find3("* of *", s, m)) { month = indexOfIC(englishMonthNames(), $2)+1; if (month >= 1) { day = or0(ai_indexToNr($1)); if (day > 0) true; } } if (find3("* * of *", s, m)) { if (!eqicOneOf($2, "th", "rd", "nd", "st")) false; month = indexOfIC(englishMonthNames(), $3)+1; if (month >= 1) { day = parseIntOpt($1); if (day > 0) true; } } false; } public void run { say(localYear(nowOr(now)) + "/" + formatInt(month, 2) + "/" + formatInt(day, 2)); } } *() { standardAttractors(new Attractor1); } }