#( "Tracks the time" )
#mark clock=inverse

#( "This sets it to show time every N minutes of mume time, e.g. clock 60 will do it every tick" )
#( "Do a clock 0 to make it stop.  It's nice to know what time it is" )
#alias clock={#var @toften=$1;#in tick (@toften*1000) clocktick}
#alias clocktick={ti;clock @{toften}}

#alias ti={clock_update;#print ("You think it is: " + $miltime + "/" + $regtime)}
#alias sti={clock_update;#send ("say It is about " + $regtime)}
#alias nti={clock_update;#send ("narr It is about " + $regtime)}

#( "this is the alias to call when you want to use miltime/regtime" )
#alias clock_update={#if ($tisset!="yes") {#($regtime="--/--");#($miltime="--/--")}; #else {mkdisptime;mknowtime}}

#( "takes current time and makes am/pm time in miltime and regtime" )
#alias mkdisptime={#if (@tmin<10) #($tfiller = ":0"); #else #($tfiller = ":");#($miltime=%@thour + $tfiller + %@tmin);#if (@thour>11) {#($tampm="pm");#(@thour-=12)};#else #($tampm="am");#if (@thour==0) #(@thour = 12);#($regtime=%@thour + $tfiller + %@tmin + $tampm)}

#( "After running @thour and @tmin == current hour/min" )
#alias mknowtime={#(@tpassed=((timer-@ttimer)/1000)%(24*60));#(@thour=@thh+((@tpassed+@tmm)/60));#if (@thour>23) #(@thour -= 24);#(@tmin=(@tpassed+@tmm)%60)}

#( "Suck in the time to seed our clock, or key it by hand if heard in narrs" )
#alias clockset={#var @thh=$1;#var @tmm=$2;#if ("$3"=="pm" && @thh!=12) #(@thh+=12);#if ("$3"=="am" && @thh==12) #(@thh=0);#(@ttimer=timer);#var $tisset=yes;clock 17}
#action >+time-suck The current time is $1:$2 $3.={#print;clockset $1 $2 $3}

