A Storyteller object, to contain often used speeches and poses.

Author: Rinaen@AmberMUSH
Category: Other


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

MUSHCode for Storyteller

@create Storyteller Parent=10
@lock Storyteller Parent=me
&DO_ENTER Storyteller Parent=$stmake *=*:@switch words(v(ST_[%0]))=0,{&ST_[%0] me=escape(%1);@pemit %#=ST: "%0" Entered.},{@pemit %#=ST: "%0" already exists.}
&DO_POSE Storyteller Parent=$stpose *:@switch words(v(ST_[%0]))=0,{@pemit %#=ST: "%0" doesn't exist.},{@fo owner(me)=:[v(ST_[%0])]}
&DO_SAY Storyteller Parent=$stsay *:@switch words(v(ST_[%0]))=0,{@pemit %#=ST: "%0" doesn't exist.},{@fo owner(me)=say [v(ST_[%0])]}
&DO_EMIT Storyteller Parent=$stemit *:@switch words(v(ST_[%0]))=0,{@pemit %#=ST: "%0" doesn't exist.},{@fo owner(me)=@emit [v(ST_[%0])]}
&DO_OTHER Storyteller Parent=$stother *:@switch words(v(ST_[%0]))=0,{@pemit %#=ST: "%0" doesn't exist.},{@fo owner(me)=[v(ST_[%0])]}
&DO_LIST Storyteller Parent=$stlist:@pemit %#=ST (All Stored):%b[edit([sort([edit(lattr(me/st_*),ST_,%b)])],%b,[,]%b)]
&DO_DELETE Storyteller Parent=$strem *:@switch words(v(ST_[%0]))=0,{@pemit %#=ST: "%0" doesn't exist.},{&ST_[%0] me;@pemit %#=ST: "%0" Removed.}
&DO_LIST1 Storyteller Parent=$stlist *:@switch words(v(ST_[%0]))=0,{@pemit %#=ST: "%0" doesn't exist.},{@pemit %#=ST ([capstr(%0)]): [u(ST_[%0])]}
&DO_HELP Storyteller Parent=$sthelp:@pemit %#={[center(Storyteller Commands,55)]%r%r[ljust(stmake <name>=<text>,28)]Store <text> as <name>.%r[ljust(strem <name>,28)]Deletes <name>.%r[ljust(stedit <name>=<old>/<new>,28)]Edits <name>'s text, replacing <old> with <new>.%r[space(28)]Use $ and ^ in <old> to append and prepend text,%r[space(28)]respectively.%r[ljust(stlist,28)]Lists all stored Storyteller parts.%r[ljust(stlist <name>,28)]Shows the <text> for <name>.%r%r[ljust(stpose <name>,28)]Makes you pose <name>.%r[ljust(stsay <name>,28)]Makes you say <name>.%r[ljust(stemit <name>,28)]Makes you @emit <name>.%r[ljust(stother <name>,28)]Makes you perform the commands stored under%r[space(28)]<name>. This is a catch-all category that allows%r[space(28)]you to do miscellaneous commands, such as %r[space(28)]'get key'. You may use ; this way.%r%rNOTE: Do not use spaces in <name>, for any command.%r%rQuestions, comments, suggestions, donations: +mail Rinaen%r}
&DO_EDIT Storyteller Parent=$stedit *=*/*:@switch words(v(ST_[%0]))=0,{@pemit %#=ST: "%0" doesn't exist.},{&st_[%0] me=[edit(v(st_[%0]),%1,%2)];@pemit %#=ST: "%0" changed to: [u(st_[%0])]}
&DO_SETUP Storyteller Parent=$stsetup:@lock me=%#;@lock/use me=%#;@set me=safe;@pemit %#=Storyteller setup complete. Make sure the Storyteller is set INHERIT! Type 'sthelp' for commands.
@Desc Storyteller Parent=A Storyteller object, to contain often used speeches & poses. To use this object, type these two commands exactly:%r%r@set [num(me)]=inherit%rstsetup%r
@Adesc Storyteller Parent=@pemit %#=(Type 'sthelp' for help.)
@set Storyteller Parent=DARK
@set Storyteller Parent=STICKY
@set Storyteller Parent=PARENT_OK
@set Storyteller Parent=SAFE