!7 module TimerModule > DynBigNumber { long setTill; start { dm_onTopInput(voidfunc(S s) { new Matches m; if "* minutes" { int minutes = parseEnglishNumberOrInt($1); setField(setTill, now()+fromMinutes(minutes)); print("Timer set to " + minutes + " from now"); } }); doEvery(1.0, r updateMe); } void update { long now = now(); if (setTill == 0) ret with setValue(""); if (setTill <= now) ret with setValue("ALARM!"); else { long seconds = iround(toSeconds(setTill-now)); setValue(seconds/60 + ":" + mod(seconds, 60)); } } }