Elsidh's Diary Parent

A diary that allows you to make named entries.

Author: Elsidh@M*U*S*H
Category: Other
Commands: @create, @edit, @lock, @pemit, @set, @switch.


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

MUSHCode for Elsidh's Diary Parent

@create Parent: Diary
@lock Parent: Diary ==me
@set Parent: Diary = LINK_OK
@set Parent: Diary = VISUAL
&ADESCRIBE Parent: Diary=@pemit %#=Type 'dhelp' for diary commands.
@set Parent: Diary/ADESCRIBE=no_command
&CMD-EDIT Parent: Diary=$dedit *=*:@swi [hasattr(me,entry-%0)]=0,{@pemit %#=You leaf through the diary, but discover there is no entry called [capstr(%0)]!},{@emit/room [name(%#)] writes in the [name(me)].;@pemit %#=You edit entry %0.;@edit me/entry-%0=$,%r%r<Edit>:%r%1%r%t-- [name(%#)] ([time()])}
&CMD-HELP Parent: Diary=$dhelp:@pemit %#=[center(<Diary Commands>,79,-)]%rdlist--- list the diary entries%rdread <entry name> --- read a diary entry%rdwrite <entryname>=<your entry> --- add to the diary.%rderase <entry name> --- erase an entry%rdedit <entry name>=<text to be appended to entry>%r%rNOTE: entryname mustbe one word. Also, the dedit will only work if the entry %ris already present.%r[repeat(-,79)]%rContact Paul if you have any problems.%r[repeat(-,79)]
&CMD-LIST Parent: Diary=$dlist:@emit/room [name(%#)] looks at the [name(me)].;@pemit %#=You look through the entries:%r[repeat(=,79)]%r[u(xlist)]%r[repeat(=,79)]%r(type 'dread <entryname>' to read an entry)
&CMD-READ Parent: Diary=$dread *:@emit/room [name(%#)] flips through the [name(me)].;@pemit %#=You read from the [name(me)]:%r[center(capstr(lcstr(%0)),79,=)]%r[u(entry-%0)]%r[repeat(=,79)]%
&CMD-REMOVE-ENTRY Parent: Diary=$derase *:@emit/room [name(%#)] rips a page outof the [name(me)].;@pemit %#=You remove the page from your [name(me)]:%r[u(entry-%0)];&entry-%0 me=;
&CMD-WRITE Parent: Diary=$dwrite *=*:@emit/room [name(%#)] writes in the [name(me)].;@pemit %#=You add your entry.;&entry-%0 me=On [time()] [name(%#)] writes:%r%1
&DESCRIBE Parent: Diary=A big book with a black cover, filled with assorted scribbles and blank pages.
@set Parent: Diary/DESCRIBE=no_command visual public nearby
@set Parent: Diary=ENTRY-TEST:On Sat Jan 11 05:32:51 2003 Elsidh writes:%rtesting
@set Parent: Diary/ENTRY-TEST=no_command
&XLIST Parent: Diary=[u(xlist-show,iter(lattr(me/entry-*),[capstr(lcstr(mid(##,6,sub(strlen(##),6))))]))]
&XLIST-SHOW Parent: Diary=switch(gt(words(%0),4),1,iter(extract(%0,1,3),[ljust(mid(##,0,25),25)])%r[u(xlist-show,extract(%0,4,sub(words(%0),3)))],iter(%0,[ljust(mid(##,0,25),25)]))