In honor of Ix's coding prowess, and because I was asked, here is the TinyMUX version of the Logger, formatted for Muxify.
Skol.
/*
This is the TinyMUX version of the code
The logging parent:
================================================================================
== LOGGING PARENT ==============================================================
--------------------------------------------------------------------------------
-- Setup: Logging Parent -------------------------------------------------------
*/
@create Logging Parent <LP>=10
// use your own code here if you want
&.header Logging Parent <LP>=header( %0 )
&.footer Logging Parent <LP>=footer( %0 )
@ahear Logging Parent <LP>=
@break
cor(
u( include.check_ooc, %0 ),
u( include.check_connect, %0 )
);
&log-[inc( after( last( sortby( sort_log, lattr( me/LOG-* ))), - ))] me=
[secs( )] %0
&include.check_ooc Logging Parent <LP>=
cand(
strmatch( v( include_ooc ), 0 ),
strmatch( first( %0 ), *OOC* )
)
&include.check_connect Logging Parent <LP>=
cor(
strmatch( %0, * has connected. ),
strmatch( %0, * has disconnected. ),
strmatch( %0, * has reconnected. ),
strmatch( %0, * has partially disconnected )
)
@Desc Logging Parent <LP>=
Status: [ifelse( v( logging ), [ansi( hg, ON )], [ansi( hr, OFF )] )]%r
OOC Included? [ifelse( v( include_ooc ), ansi( hg, YES ), ansi( hr, NO ))]
%r%r
[ansi( hw, Scene Information: )]%r
%t[ansi( hw, Summary )]: [get( me/SCENE-SUMMARY )]%r
%t[ansi( hw, Date )]: [get( me/SCENE-DATE )]%r
%t[ansi( hw, Cast )]: [iter( get( me/SCENE-CAST ), name( %i0 ))]%r
%t[ansi( hw, Location Name )]: [get( me/SCENE-LOCATION )]%r
%t[ansi( hw, Location Description )]: [get( me/SCENE-LOCATIONDESC )]
%r%r
[ansi( hw, Log entries recorded )]: [words( lattr( me/LOG-* ))]
&DO-SET-LOG-OOC Logging Parent <LP>=
&include_ooc me=[not( get( me/include_ooc ))];
@remit %l=
[ansi( hy, OOC )]:
[name( me )] is now set
[ifelse( v( include_ooc ), ansi( hg, TO ), ansi( hr, TO NOT ))]
include OOC communication.
&DO-SHOW-LOG Logging Parent <LP>=
@eval [setq( 0, sortby( sort_log, lattr( me/LOG-* )))];
@dolist
HEADER
[ifelse( t( %2 ), revwords( extract( revwords( %q0 ), 1, %2 )), %q0 )]
FOOTER={
@pemit %0=[switch( ##,
HEADER, u( SHOW_HEADER_%1 ),
FOOTER, u( SHOW_FOOTER_%1 ),
u( SHOW_LOG_%1, ## )
)]
}
&DO-START-LOG Logging Parent <LP>=
&logging me=1;
@listen me=*;
@remit loc( me )=
[ansi( hy, OOC )]: This scene is now being logged by
[ansi( hw, name( me ))].
&DO-STOP-LOG Logging Parent <LP>=
&logging me=0;
@remit loc( me )=
[ansi( hy, OOC )]: This scene is no longer being logged by
[ansi( hw, name( me ))].
&DO-UNDO-LOG Logging Parent <LP>=
&log-[after( last( sortby( sort_log, lattr( me/LOG-* ))), - )] me;
@pemit/contents loc( me )=
[ansi( hw, OOC )]: The last entry in the log has been undone.
&INCLUDE_OOC Logging Parent <LP>=0
@Listen Logging Parent <LP>=*
&LOGGING Logging Parent <LP>=0
&MESSAGE_LOGGING0 Logging Parent <LP>=
[ansi( y, OFF )]
&MESSAGE_LOGGING1 Logging Parent <LP>=
[ansi( hg, ON )] [ansi( hr, - SCENE IS BEING LOGGED )]
&SHORTDESC Logging Parent <LP>=
is currently [u( message_logging[v( logging )] )].
&SHOW_FOOTER_PLAIN Logging Parent <LP>=
[footer( [ansi( hw, end of log )] )]
&SHOW_FOOTER_WIKI Logging Parent <LP>=
[u( .footer, ansi( hw, end of log ))]
&SHOW_HEADER_PLAIN Logging Parent <LP>=
[u( .header, ansi( hw, [name( me )]'s Log ))]
// this, er, is literal text for the wiki. why aren't the [[ ]] escaped?
&SHOW_HEADER_WIKI Logging Parent <LP>=
[u( .header, ansi( hw, [name( me )]'s Log ))]%r
[[include logheader%r
|summary=[get( me/SCENE-SUMMARY )]%r
|location=[get( me/SCENE-LOCATION )]%r
|desc=[get( me/SCENE-LOCATIONDESC )]%r
]]
%r%r
[[include logcastbegin]]%r
[iter( get( me/SCENE-CAST ),
[[include logccon name=[lcstr( name( %i0 ))] ]], %b, %r
)]%r
[[include logcastend]]
%r%r
[[include logstart]]
%r%r====%r%r
&SHOW_LOG_PLAIN Logging Parent <LP>=
[setq( 0, get( me/%0 ))]
// [ansi( hx, %[[timefmt( $02H:$02T:$02S $P, first( %q0 ))]%] )] // penn/rhost
[ansi( hx, %[[timefmt( %r, first( %q0 ))]%] )] // mux
[rest( %q0 )]
&SHOW_LOG_WIKI Logging Parent <LP>=
[rest( get( me/%0 ))]%r%r-----%r%r
&SORT_LOG Logging Parent <LP>=
sub( after( %0, - ), after( %1, - ))
@set Logging Parent <LP>=NO_COMMAND
/*
================================================================================
== LOGGING COMMANDS ============================================================
%vp is used globally as 'the logging parent'
%ql is used globally as 'the logger object' (%q<logger> in penn/rhost)
--------------------------------------------------------------------------------
-- Setup: Logging Commands -----------------------------------------------------
*/
@create Logging Commands <LC>=10
@set Logging Commands <LC>=INHERIT
@fo me=@VP Logging Commands <LC>=[num( Logging Parent <LP> )]
&lock.isapproved Logging Commands <LC>=isapproved( %# )
@lock/use Logging Commands <LC>=LOCK.ISAPPROVED/1
// would be nice to have a fail message here, but not for mux
// penn/rhost version also sets this no_inherit. not sure why.
/*
--------------------------------------------------------------------------------
-- Functions: Logging Commands -------------------------------------------------
return '1' if check passes, '0' if failed.
*/
&include.locate_object Logging Commands <LC>=
strcat(
setq( l, locate( %#, %0, Tn )),
case( 0,
t( %ql ),
pemit( %#,
I can't find an object named [ansi( hw, %0 )] at your location.
)0,
1
)
)
&include.do_check_basic Logging Commands <LC>=
strcat(
case( 0,
u( include.locate_object, %0 ), 0,
match( parent( %ql ), %vp ),
pemit( %#, That object is not a Scene Logger. )0,
1
)
)
&include.do_check_controls Logging Commands <LC>=
case( 0,
u( include.do_check_basic, %0 ), 0,
controls( %#, %ql ), pemit( %#, You do not control that scene logger.)0,
1
)
&include.owns_object Logging Commands <LC>=
case( 0,
t( u( include.locate_object, %0 )), 0,
controls( %#, %ql ), pemit( %#, That object is not yours. )0,
1
)
/*
--------------------------------------------------------------------------------
-- Commands: Logging Commands --------------------------------------------------
%qc: cast to who? (%q<cast> in penn/rhost)
*/
&CMD-+LOG/CAPTURE Logging Commands <LC>=$+log/capture *:
@assert u( include.do_check_basic, %0 );
&scene-cast %ql=[lcon( %l, connect )];
&scene-location %ql=[name( %l )];
&scene-locationdesc %ql=
[ifelse( hasflag( %l, temporary ),
objeval( owner( %ql ), u( %l/tempdesc )),
objeval( owner( %ql ), u( %l/desc ))
)];
&scene-date %ql=[time( )];
@pemit %#=Captured.
&CMD-+LOG/CAST Logging Commands <LC>=$+log/cast *=*:
@assert u( include.do_check_basic, %0 );
@eval [setq( c, iter( %1, pmatch( %i0 )))];
@break strmatch( %qc, *#-1* )={
@pemit %#=I can't find anyone named:
[iter( %1, ifelse( t( pmatch( %i0 )), , %i0 ))].
};
&SCENE-CAST %ql=%qc;
@pemit %#=
[ansi( hy, OOC )]:
Cast set to: [itemize( iter( %qc, name( %i0 ), %b, | ), | )].
&CMD-+LOG/DATE Logging Commands <LC>=$+log/date *=*:
@assert u( include.do_check_basic, %0 );
&scene-summary %ql=[ifelse( strmatch( lcstr( %1 ), today ), time( ), %1 )];
@pemit %#=[ansi( hy, OOC: Date set to: [ansi( hw, %1 )].
&CMD-+LOG/LOCDESC Logging Commands <LC>=$+log/location/desc *=*:
@assert u( include.do_check_basic, %0 );
&SCENE-LOCATIONDESC %ql=
[switch( %1, here, objeval( %#, u( %l/desc )), %l )];
@pemit %#=
[ansi( hy, OOC )]: Location description set to:
[get( %ql/SCENE-LOCATIONDESC )].;
&CMD-+LOG/LOCNAME Logging Commands <LC>=$+log/location/name *=*:
@assert u( include.do_check_basic, %0 );
&SCENE-LOCATION %ql=[switch( %1, here, name( %l ), %1 )];
@pemit %#=
[ansi( hy, OOC )]: Location name set to: [get( %ql/SCENE-LOCATION )].;
&CMD-+LOG/MAKE Logging Commands <LC>=$+log/make *:
@assert u( include.owns_object, %0 );
@break hastype( %ql, PLAYER )={@pemit %#=You can't make a player a logger!};
@assert t( %ql )={@pemit %#=I can't find an object named [ansi( hw, %0 )].};
@break match( parent( %ql ), %vp )={
@pemit %#=That object is already a scene logger.
};
@parent %ql=%vp;
&LOGGING %ql=0;
@lock/use %ql=logging/1;
@set %ql=!no_command;
@listen %ql=*;
@pemit %#=You have made [ansi( hw, name( %ql ))] a Scene Logger.;
&CMD-+LOG/OFF Logging Commands <LC>=$+log/off *:
@assert u( include.do_check_basic, %0 );
@assert get( %ql/logging )={
@pemit %#=[ansi( hw, name( %ql ))] is not logging this scene.
};
@tri %ql/DO-STOP-LOG=%ql
&CMD-+LOG/ON Logging Commands <LC>=$+log/on *:
@assert u( include.do_check_controls, %0 );
@break get( %ql/logging )={
@pemit %#=[ansi( hw, name( %ql ))] is already logging this scene.
};
@tri %ql/DO-START-LOG=%ql
&CMD-+LOG/OOC Logging Commands <LC>=$+log/ooc *:
@assert u( include.do_check_controls, %0 );
@tri %ql/DO-SET-LOG-OOC=%#
&CMD-+LOG/RECLAIM Logging Commands <LC>=$+log/reclaim:
@assert u( .isapproved, %# )={
@pemit %#=Approved characters only
};
@pemit %#=[ansi( hw, OOC )]: Reclaiming all your loggers...;
@dol children( %vp )={
@assert strmatch( %#, owner( %i0 ));
&logging %i0=0;
@tel %i0=%#
}
&CMD-+LOG/RETURN Logging Commands <LC>=$+log/return *:
@assert u( include.do_check_basic, %0 );
@tri %ql/DO-STOP-LOG=%ql;
@tel %ql=owner( %ql );
@mail/quick [name( owner( %ql ))]=
Logger Returned//[name( %# )] has returned your logger to you from
[name( %l )];
&CMD-+LOG/SHOW Logging Commands <LC>=$+log/show *:
@break strmatch( %0, *=* );
@assert u( include.do_check_basic, %0 );
@tri %ql/DO-SHOW-LOG=%#, plain
&CMD-+LOG/SHOW-LAST Logging Commands <LC>=$+log/last *=*:
@assert isint( %1 )={
@pemit %#=
The second argument is expected to be a number, got [ansi( hw, %1 )]
};
@assert u( include.do_check_basic, %0 );
@tri %ql/DO-SHOW-LOG=%#, plain, %1
&CMD-+LOG/SUMMARY Logging Commands <LC>=$+log/summary *=*:
@assert u( include.do_check_basic, %0 );
&SCENE-SUMMARY %ql=%1;
@pemit %#=[ansi( hy, OOC )]: Summary set to: [ansi( hw, %1 )].
&CMD-+LOG/UNDO Logging Commands <LC>=$+log/undo *:
@assert u( include.do_check_basic, %0 );
@tri %ql/DO-UNDO-LOG=%ql
&CMD-+LOG/WIKI Logging Commands <LC>=$+log/wiki *:
@assert u( include.do_check_basic, %0 );
@tri %ql/DO-SHOW-LOG=%#, wiki
&CMD-+LOG/WIPE Logging Commands <LC>=$+log/wipe *:
@assert u( include.do_check_controls, %0 );
@wipe %ql/LOG-*;
@wipe %ql/SCENE-*;
@pemit %#=[ansi( hw, name( %ql ))] has had its current log wiped.
&CMD-+LOG/POSE Logging Commands <LC>=$+log/pose *=*:
@assert u( include.do_check_basic, %0 );
@tri %ql/ahear=%1;
@pemit %#=[ansi( hw, OOC )]: Pose added.
/*
================================================================================
== HELP TEXT ===================================================================
This text has no hard-breaks at 80 columns. Format to your liking
-- BEGIN --
The +log system is used for logging of scenes in such a way that it minimizes the amount of stuff you have to clean before posting, not to mention making sure you post the log in the correct format.
The scene revolves around Scene Loggers, which are plain objects that you own and re-use from one scene to the next. You never really need to have more then one. To create a <logger>, type: @create <logger> and then drop it. You can make this a scene <logger> then by typing: +log/make <logger>. Once you drop the <logger>, the following commands are available:
+log/on <logger> - activate logging
+log/off <logger> - deactivate logging
+log/ooc <logger> - toggle if OOC communication is logged. Default: off.
+log/show <logger>=X - show the current log or X lines of it. ( =X is optional. ).
+log/wipe <logger> - clear the current log.
+log/undo <logger> - remove the last entry in the log. Useful to repose a correction.
+log/pose <logger>=<pose> - add a pose directly to the logger
Before posting, you can store the scene information with:
+log/summary <logger>=description - set summary of current scene
+log/cast <logger>=person1 person2 .. personN - set participants in log
+log/location/name <logger>=name - name of place where log takes place. 'here' gets current room name.
+log/location/desc <logger>=text - description of place where log takes place. 'here' takes current room desc.
+log/capture <logger> - cast, location/name and location/desc all in one handy command
When you're ready to post your log, +log/wiki <logger> will show you the current log and wiki formatting.
When done, just 'get' your <logger> and take it with you. If you see someone's <logger> laying around, +log/return <logger> will return it to their inventory.
If you've lost your logger, +log/reclaim will teleport ALL of your loggers to your inventory whether they're in use or not.
-- END --
*/