Kyieren's Data Watch

This customizable watch does a variety of things, like managing teleport destinations, handling text files, keeping track of outfit descriptions, and of course, keeping time.

Author: Kyieren@M*U*S*H
Category: Other
Compatibility: CobraMUSH, PennMUSH.

Instructions

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

MUSHCode for Kyieren's Data Watch

@create Data Watch Parent
@link Data Watch Parent = #0
@lock/Basic Data Watch Parent==#1635
@lset Data Watch Parent/Basic=no_inherit
@set Data Watch Parent = LINK_OK
@set Data Watch Parent = VISUAL
@set Data Watch Parent = !NO_COMMAND
&CREDITS Data Watch Parent=Kyieren @ M*U*S*H (mwilmington@postmark.net). This watch is free for use on anyone's MU*, as long as proper credit is given, no matter what modifications you choose to make to this code.
&DESCRIBE Data Watch Parent=A silver watch with a tiny screen and several colorful buttons on it. Type '+whelp' for help.
@set Data Watch Parent/DESCRIBE=no_command visual public nearby
&DEST_#0 Data Watch Parent=#0
&GRAPHIC Data Watch Parent=[tagwrap(pre,[space(2)]%r[space(10)][ansi(w,/%\)]%r[space(9)][ansi(w,|--|)]%r[space(9)][ansi(w,|--|)]%r[space(9)][ansi(w,|)][space(2)][ansi(w,|)]%r[space(8)][ansi(w,_|__|_)]%r[space(7)][ansi(w,/)][space(6)][ansi(w,%\)]%r[space(6)][ansi(w,|)][ansi(h,[extract([time()],4,1)])][ansi(w,|)]%r[space(6)][ansi(w,|)]%b+thelp%b[ansi(w,|)]%r[space(7)][ansi(w,%\______/)]%r[space(9)][ansi(w,|)][space(2)][ansi(w,|)]%r[space(9)][ansi(w,|o%b|)]%r[space(9)][ansi(w,|o%b|)]%r[space(9)][ansi(w,|o%b|)]%r[space(10)][ansi(w,%\/)]%r[space(10)])]
@set Data Watch Parent/GRAPHIC=no_command visual
&TEL Data Watch Parent=$+wtel *:@switch hasattrp(me,DEST_%0)=1,{@remit %l=%n taps a few buttons on %p watch.;@fo here=@tel [u(me/DEST_%0)];@wait 1=@switch strmatch(%l,[u(me/DEST_%0)])=1,@pemit/silent %n=[name(me)] beeps and says\, "Teleport successful.",@pemit/silent %n=[name(me)] beeps and says\, "Teleport failed."},@pemit/silent %n=[name(me)] beeps and says\, "Teleport destination '[ucstr(%0)]' does not exist."
&WCADD Data Watch Parent=$+wcadd *:@remit %l=%n taps a few buttons on %p watch,;@fo here=@cpattr me/describe=%!/outfit_%0;@pemit/silent %n=[name(me)] beeps and says, "Current outfit '[ucstr(%0)]' stored."
&WDADD Data Watch Parent=$+wdadd *=*:@remit %l=%n taps a few buttons on %p watch.;&DEST_%0 me=%1;@pemit/silent %n=[name(me)] beeps and says, "Teleport destination '[ucstr(%0)]' set."
&WDDEL Data Watch Parent=$+wddel *:@remit %l=%n taps a few buttons on %p watch.;@switch hasattrp(me,DEST_%0)=1,{@wipe me/DEST_%0;@pemit/silent %n=[name(me)] beeps and says\, "Teleport destination '[ucstr(%0)]' removed."},@pemit/silent %n=[name(me)] beeps and says\, "Teleport destination '[ucstr(%0)]' does not exist."
&WDEDIT Data Watch Parent=$+wdedit *=*,*:@remit %l=%n taps a few buttons on %p watch.;@switch hasattr(me,DEST_%0)=1,{@edit me/DEST_%0=%1,%2;@pemit/silent %n=[name(me)] beeps and says\, "Teleport destination '[ucstr(%0)]' : [u(me/DEST_%0)]"},@pemit/silent %n=[name(me)] beeps and says\, "Teleport destination '[ucstr(%0)]' does not exist."
&WDHELP Data Watch Parent=$+wdhelp:@remit %l=%n taps a few buttons on %p watch.;@pemit/silent %n=[name(me)] beeps and says, "To add a destination, use '+wdadd <destination name>=<dbref #>'. To delete a destination, use '+wddel <destination name>'. To read the dbref # of a destination, use '+wdread <destination name>'. To edit a destination, use '+wdedit <destination name>=<old dbref #>,<new dbref #>'. To list destinations stored, use '+wdlist'. To go to a destination, use '+wtel <destination name>'. To join a player at their JUMP_OK location, use '+wjoin <player name>'. In all instances, <destination name> must be one word or separated by underscores (_), and <dbref #> must either be set JUMP_OK or be owned by you."
&WDLIST Data Watch Parent=$+wdlist:@remit %l=%n taps a few buttons on %p watch.;@pemit/silent %n=[name(me)] beeps and says, "Stored destinations are: [iter([setunion(lattr(me/DEST_*),lattr(parent(me)/DEST_*))],[after(##,DEST_)])]."
&WDREAD Data Watch Parent=$+wdread *:@remit %l=%n taps a few buttons on %p watch.;@switch hasattrp(me,DEST_%0)=1,{@pemit/silent %n=[name(me)] beeps and says\, "Teleport destination '[ucstr(%0)]' : [u(me/DEST_%0)]"},@pemit/silent %n=[name(me)] beeps and says\, "Teleport destination '[ucstr(%0)]' does not exist."
&WHELP Data Watch Parent=$+whelp:@remit %l=%n taps a few buttons on %p watch.;@pemit/silent %n=[name(me)] beeps and says, "This customizable watch does a variety of things, like managing teleport destinations, handling text files, keeping track of outfit descriptions, and of course, keeping time. This object must be set INHERIT, QUIET, and !NO_COMMAND to work properly. To get the current time, use '+wtime'. See '+wohelp' for outfit help, '+wdhelp' for teleport destination help, and '+wmhelp' for message help. If you need assistance, use 'think \[get(%!/credits)\]'. Have fun!"
&WJOIN Data Watch Parent=$+wjoin *:@remit %l=%n taps a few buttons on %p watch.;@remit [loc(*%0)]=GAME: %n is attempting to join your location.;@wait 1={@fo here=@tel [loc(*%0)]};@wait 2={@switch strmatch(%l,[loc(*%0)])=1,@pemit/silent %n=[name(me)] beeps and says\, "Teleport successful.",@pemit/silent %n=[name(me)] beeps and says\, "Teleport failed."}
&WMADD Data Watch Parent=$+wmadd *=*:@remit %l=%n taps a few buttons on %p [name(me)].;&message_%0 me=%1;@pemit/silent %n=[name(me)] beeps and says, "Message '[ucstr(%0)]' stored."
&WMDEL Data Watch Parent=$+wmdel *:@remit %l=%n taps a few buttons on %p watch.;@switch hasattr(me,message_%0)=1,{@wipe me/message_%0;@pemit/silent %n=[name(me)] beeps and says\, "Message '[ucstr(%0)]' deleted."},@pemit/silent %n=[name(me)] beeps and says\, "Message '[ucstr(%0)]' does not exist."
&WMEDIT Data Watch Parent=$+wmedit *=*,*:@remit %l=%n taps a few buttons on %p watch.;@switch hasattr(me,message_%0)=1,{@edit me/message_%0=%1,%2;@pemit/silent %n=[name(me)] beeps and says\, "Message '[ucstr(%0)]' : [u(me/message_%0)]"},@pemit/silent %n=[name(me)] beeps and says\, "Message '[ucstr(%0)]' does not exist."
&WMHELP Data Watch Parent=$+wmhelp:@remit %l=%n taps a few buttons on %p watch.;@pemit/silent %n=[name(me)] beeps and says, "To add a message, use '+wmadd <message name>=<message>'. To delete a message, use '+wmdel <message name>'. To read a message, use '+wmread <message name>'. To edit a message, use '+wmedit <message name>=<old text>,<new text>'. To @mail a message to someone, use '+wmmail <message name>=<player name>'. To list messages currently stored, use '+wmlist'. In all instances, <message name> must be one word or separated by underscores (_)."
&WMLIST Data Watch Parent=$+wmlist:@remit %l=%n taps a few buttons on %p watch.;@pemit/silent %n=[name(me)] beeps and says, "Stored messages are: [iter([lattr(me/message_*)],[after(##,message_)])]."
&WMMAIL Data Watch Parent=$+wmmail *=*:@remit %l=%n taps a few buttons on %p watch.;@switch hasattr(me,message_%0)=1,{@mail [name(*%1)]=From: %n - Re: [ucstr(%0)]/[u(me/message_%0)];@pemit/silent %n=[name(me)] beeps and says\, "Message '[ucstr(%0)]' sent to [name(*%1)]."},@pemit/silent %n=[name(me)] beeps and says\, "Message '[ucstr(%0)]' does not exist.
&WMREAD Data Watch Parent=$+wmread *:@remit %l=%n taps a few buttons on %p watch.;@switch hasattr(me,message_%0)=1,{@pemit/silent %n=[name(me)] beeps and says\, "Message '[ucstr(%0)]' : [u(me/message_%0)]"},@pemit/silent %n=[name(me)] beeps and says\, "Message '[ucstr(%0)]' does not exist."
&WOADD Data Watch Parent=$+woadd *=*:@remit %l=%n taps a few buttons on %p watch.;&OUTFIT_%0 me=%1;@pemit/silent %n=[name(me)] beeps and says, "Outfit '[ucstr(%0)]' set."
&WODEL Data Watch Parent=$+wodel *:@remit %l=%n taps a few buttons on %p watch.;@switch hasattr(me,OUTFIT_%0)=1,{@wipe me/OUTFIT_%0;@pemit/silent %n=[name(me)] beeps and says\, "Outfit '[ucstr(%0)]' removed."},@pemit/silent %n=[name(me)] beeps and says\, "Outfit '[ucstr(%0)]' does not exist.
&WOEDIT Data Watch Parent=$+woedit *=*,*:@remit %l=%n taps a few buttons on %p watch.;@switch hasattr(me,message_%0)=1,{@edit me/OUTFIT_%0=%1,%2;@pemit/silent %n=[name(me)] beeps and says\, "Outfit '[ucstr(%0)]' : [u(me/OUTFIT_%0)]"},@pemit/silent %n=[name(me)] beeps and says\, "Outfit '[ucstr(%0)]' does not exist."
&WOHELP Data Watch Parent=$+wohelp:@remit %l=%n taps a few buttons on %p watch.;@pemit/silent %n=[name(me)] beeps and says, "To add an outfit, use '+woadd <outfit name>=<outfit>'. To add the outfit you are currently wearing, use '+wcadd <desired outfit name>'. To delete an outfit, use '+wodel <outfit name>'. To read an outfit's description, use '+woread <outfit name>'. To edit an outfit, use '+woedit <outfit name>=<old text>,<new text>'. To list outfits currently stored, use '+wolist'. To wear an outfit, use '+wowear <outfit name>'. WARNING: This command overwrites your entire description! In all instances, <outfit name> must be one word or separated by underscores (_)."
&WOLIST Data Watch Parent=$+wolist:@remit %l=%n taps a few buttons on %p watch,;@pemit/silent %n=[name(me)] beeps and says, "Stored outfits are: [iter([lattr(me/OUTFIT_*)],[after(##,OUTFIT_)])]."
&WOREAD Data Watch Parent=$+woread *:@remit %l=%n taps a few buttons on %p watch.;@switch hasattr(me,OUTFIT_%0)=1,{@pemit/silent %n=[name(me)] beeps and says\, "Outfit '[ucstr(%0)]' : [u(me/OUTFIT_%0)]"},@pemit/silent %n=[name(me)] beeps and says\, "Outfit '[ucstr(%0)]' does not exist."
&WTIME Data Watch Parent=$+wtime:@remit %l=%n taps a few buttons on %p watch.;@pemit/silent %n=[name(me)] beeps and says, "It is currently [time()]."