Grandfather Clock

Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for Grandfather Clock

@@ -*- mushcode -*- $Id: clock.txt 1.2 Wed, 02 Aug 2000 22:39:31 -0700 shawnw $
@create Clock Parent
@lock/Basic Clock Parent==me
@lock/Parent Clock Parent=!=#0
@lock/Link Clock Parent==#0
@set Clock Parent = LINK_OK
@set Clock Parent = VISUAL
@set Clock Parent = SAFE
@set Clock Parent = NO_COMMAND
&DEFAULT_DESC Clock Parent=The clock parent.
@set Clock Parent/DEFAULT_DESC=no_inherit
@DESCRIBE Clock Parent=[u(default_desc)]%r[udefault(face-%xa,No such clock face.)]%r[if(match(%!, first(lparent(me))),u(help))]
@set Clock Parent/DESCRIBE=no_command visual
&FACE-ANALOG Clock Parent=[edit(edit(edit(edit(iter(escape(merge(u(hour-[u(get_hour)]),u(minute-[div(u(get_minute),5)]),_)),center(##,78),~,%r),0,ansi(r,0)),o,ansi(g,o)),O,ansi(y,O)),_,%b)]%r[center(AKA,78)]%r[center(ansi(u,u(time) (%xc)),78)]
&FACE-DIGITAL Clock Parent=[space(20)][edit(u(#2211/letter,[u(get_hour)]:[u(get_minute)]),%r,%r[space(20)])]
@FAILURE Clock Parent=It's too large to abscond with. Sorry.
@set Clock Parent/FAILURE=no_command
&GET_HOUR Clock Parent=[switch(val(extract(u(time),1,1,:)),>11,sub(#$,12),#$)]
&GET_MINUTE Clock Parent=[extract(u(time),2,1,:)]
&HELP Clock Parent=To use the clock parent, @create an object, and @parent it to %!. Then, set it's @xa attribute to analog or digital. If you wish, give it a &DEFAULT_DESC, which is shown before the clock face. For information on how to make it work with IC time instead of RL time, talk to [name(owner(me))]. Credits: Raevnos for the code. Trivian for pointing out that merge() actually does have a use.
&HOUR-0 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/_____________o______________\\~/______________|_______________\\~|______________|_______________|~|______________|_______________|~|______________|_______________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-1 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/__________________o_________\\~/__________________/___________\\~|_________________/____________|~|________________/_____________|~|_______________/______________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-10 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|________o_____________________|~|__________\\___________________|~|____________\\_________________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-11 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/________o___________________\\~/__________\\___________________\\~|___________\\__________________|~|____________\\_________________|~|_____________\\________________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-2 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|____________________o_________|~|__________________/___________|~|________________/_____________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-3 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O------o________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-4 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|________________\\_____________|~|___________________\\__________|~|______________________o_______|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-5 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|_______________\\______________|~|________________\\_____________|~|_________________\\____________|~\\__________________\\___________/~\\__________________o_________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-6 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|______________|_______________|~|______________|_______________|~|______________|_______________|~\\______________|_______________/~\\_____________o______________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-7 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|_____________/________________|~|____________/_________________|~|___________/__________________|~\\__________/___________________/~\\________o___________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-8 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|___________/__________________|~|_________/____________________|~|_______o______________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&HOUR-9 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|_______o------O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&LICENSE Clock Parent=This object (Raevnos' Clock Parent) is released under the Gnu Public License. A copy of that license is avaliable at [tagwrap(a, href="http://www.gnu.org/copyleft/gpl.html", http://www.gnu.org/copyleft/gpl.html)]
&MINUTE-0 Clock Parent=/--------------------\\~/______________________\\~/___________0____________\\~/____________|_____________\\~/_____________|______________\\~/______________|_______________\\~|______________|_______________|~|______________|_______________|~|______________|_______________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&MINUTE-1 Clock Parent=/--------------------\\~/______________________\\~/__________________0_____\\~/__________________/_______\\~/__________________/_________\\~/__________________/___________\\~|_________________/____________|~|________________/_____________|~|_______________/______________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&MINUTE-10 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______0_______________________\\~|________\\_____________________|~|__________\\___________________|~|____________\\_________________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&MINUTE-11 Clock Parent=/--------------------\\~/______________________\\~/____0___________________\\~/______\\___________________\\~/________\\___________________\\~/__________\\___________________\\~|___________\\__________________|~|____________\\_________________|~|_____________\\________________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&MINUTE-2 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________0_______\\~|____________________/_________|~|__________________/___________|~|________________/_____________|~|______________O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&MINUTE-3 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O----------0____|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&MINUTE-4 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|________________\\_____________|~|___________________\\__________|~|______________________\\_______|~\\________________________0_____/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&MINUTE-5 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|_______________\\______________|~|________________\\_____________|~|_________________\\____________|~\\__________________\\___________/~\\__________________\\_________/~\\__________________\\_______/~\\__________________0_____/~\\______________________/~\\--------------------/
&MINUTE-6 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|______________|_______________|~|______________|_______________|~|______________|_______________|~\\______________|_______________/~\\_____________|______________/~\\____________|_____________/~\\___________0____________/~\\______________________/~\\--------------------/
&MINUTE-7 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|_____________/________________|~|____________/_________________|~|___________/__________________|~\\__________/___________________/~\\________/___________________/~\\______/___________________/~\\____0___________________/~\\______________________/~\\--------------------/
&MINUTE-8 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|______________O_______________|~|___________/__________________|~|_________/____________________|~|_______/______________________|~\\_____0________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&MINUTE-9 Clock Parent=/--------------------\\~/______________________\\~/________________________\\~/__________________________\\~/____________________________\\~/______________________________\\~|______________________________|~|______________________________|~|______________________________|~|___0----------O_______________|~|______________________________|~|______________________________|~|______________________________|~\\______________________________/~\\____________________________/~\\__________________________/~\\________________________/~\\______________________/~\\--------------------/
&TIME Clock Parent=[extract(extract(time(),4,1),1,2,:)]
@XA Clock Parent=analog
@XB Clock Parent=silent
@XC Clock Parent=RL Time