[squish([mid(time(), 0, 20)][/code]
I'm just learning to use Keran's system and it's a lot to go over. The full code can be found at http://www.hatrack.net/gwen/mushcode/ker...
The code for the clock section of the code is as follows.
[code]@create Keran's Clock=10
@lock Keran's Clock=#0
@Startup Keran's Clock=@trigger me/loop
&LOOP Keran's Clock=@trigger me/routine-time-of-day; @trigger me/routine-hour; @trigger me/routine-halfhour; @trigger me/routine-quarterhour; @trigger me/routine-tide; @trigger me/routine-moon; @trigger me/routine-sun; @wait 60 = @trigger me/loop
&DAY-NIGHT-DAWN-DUSK Keran's Clock=night
&LAST-DAY-NIGHT-DAWN-DUSK Keran's Clock=night
&ROUTINE-TIME-OF-DAY Keran's Clock=&last-time-of-day me = [u(time-of-day)]; &time-of-day me = [u(#149/time-of-day)]; @switch [comp(u(last-time-of-day), u(time-of-day))] = 0, @@, @dolist [v(triggerlist-time~of~day)] = @trigger ##/trigger-at-[u(#162/blank2tilde, u(#149/time-of-day))]
&ROUTINE-HOUR Keran's Clock=&last-hour me = [u(hour)]; &hour me = [u(#149/hour)]; @switch [comp(u(hour), u(last-hour))] = 0, @@, {@dolist [v(triggerlist-hour)] = @trigger ##/trigger-at-[u(#149/hour)]; @dolist [v(triggerlist-every~hour)] = @trigger ##/trigger-at-every~hour}
&ROUTINE-TIDE Keran's Clock=&last-tide me = [u(tide)]; &tide me = [u(#164/tide)]; @switch [comp(u(tide), u(last-tide))] = 0, @@, @dolist [v(triggerlist-tide)] = @trigger ##/trigger-at-[u(#162/blank2tilde, u(#164/tide))]
&ROUTINE-MOON Keran's Clock=&last-moon-up me = [u(moon-up)]; &moon-up me = [u(#164/moon-up)]; @switch [comp(u(moon-up),
u(last-moon-up))] = 0, @@, 1, @dolist [v(triggerlist-moon)] = @trigger ##/trigger-at-moonrise, -1, @dolist [v(triggerlist-moon)] = @trigger
##/trigger-at-moonset; &last-meridian-transit me = [u(meridian-transit)]; &meridian-transit me = [gt(secs(), u(#164/meridian-transit))];
@switch [comp(u(meridian-transit), u(last-meridian-transit))] = 0, @@, 1, @dolist [v(triggerlist-moon)] = @trigger ##/trigger-at-meridian~transit
&ROUTINE-SUN Keran's Clock=&last-day-night me = [u(day-night)]; &day-night me = [u(#149/day-night)]; @switch [comp(u(day-night), u(last-day-night))] = 0, @@, -1, @dolist [v(triggerlist-sun)] = @trigger ##/trigger-at-sunrise, 1, @dolist [v(triggerlist-sun)] = @trigger ##/trigger-at-sunset
&HOUR Keran's Clock=18
&LAST-HOUR Keran's Clock=18
&ADD-TO-TRIGGERLIST Keran's Clock=$add * *: &triggerlist-%1 me = [setunion(%0, v(triggerlist-%1))]
&DELETE-FROM-TRIGGERLIST Keran's Clock=$del * *: &triggerlist-%1 me = [setdiff(v(triggerlist-%1), %0)]
&IS-ADMIN Keran's Clock=[orflags(%#, WZ)]
@lock/UseLock Keran's Clock=IS-ADMIN/1
&TRIGGERLIST-TIME~OF~DAY Keran's Clock=#153 #157 #624
&VERSION Keran's Clock=4.0
&AUTHOR Keran's Clock=Keran@Keranset Island
&TRIGGERLIST-SUN Keran's Clock=#157 #624
&TRIGGERLIST-MOON Keran's Clock=#157 #624
&TRIGGERLIST-TIDE Keran's Clock=#157 #624
&TIME-OF-DAY Keran's Clock=dusk
&DAY-NIGHT Keran's Clock=night
&LAST-TIME-OF-DAY Keran's Clock=dusk
&LAST-DAY-NIGHT Keran's Clock=day
&MOON-UP Keran's Clock=1
&LAST-MOON-UP Keran's Clock=1
&MERIDIAN-TRANSIT Keran's Clock=1
&LAST-MERIDIAN-TRANSIT Keran's Clock=1
&ROUTINE-HALFHOUR Keran's Clock=&last-halfhour me = [u(halfhour)]; &halfhour me = [u(#149/halfhour)]; @switch [comp(u(halfhour), u(last-halfhour))] = 0, @@, @dolist [v(triggerlist-every~halfhour)] = @trigger ##/trigger-at-every~halfhour
&ROUTINE-QUARTERHOUR Keran's Clock=&last-quarterhour me = [u(quarterhour)]; &quarterhour me = [u(#149/quarterhour)]; @switch [comp(u(quarterhour), u(last-quarterhour))] = 0, @@, @dolist [v(triggerlist-every~quarterhour)] = @trigger ##/trigger-at-every~quarterhour
&HALFHOUR Keran's Clock=37
&LAST-HALFHOUR Keran's Clock=37
&QUARTERHOUR Keran's Clock=76
&LAST-QUARTERHOUR Keran's Clock=75
&TRIGGERLIST-HOUR Keran's Clock=#157 #624
&TIDE Keran's Clock=high and ebbing
&LAST-TIDE Keran's Clock=high and ebbing
&TRIGGERLIST-EVERY~HALFHOUR Keran's Clock=#624
&TRIGGERLIST-EVERY~QUARTERHOUR Keran's Clock=#624
&TRIGGERLIST-EVERY~HOUR Keran's Clock=#624
@set Keran's Clock=INHERIT
@set Keran's Clock=SAFE
@set Keran's Clock=VISUAL[/code]