+getcast
This is a bit of quick'n'dirty for TinyMUX systems using one of the standard +finger commands I see in WoD games (and elsewhere). It's designed to be plugged into the SGP that comes with Tiny. Specifically, it's looking for SGP - Main Globals which is usually #6.
Please update the #6 if you want this elsewhere!
The code will check the current room you are in and grab every player bit that's there, look for their "wiki" attribute that's set in +finger, and output a list of properly formatted Wiki names. This is extremely useful all the time, but especially where you're playing games where people have bit names that do not match their Wiki page names.
Note this code looks for ##/finger-wiki and ##/wiki. If your means of logging a wiki uses a different attribute on the player bit, you'll need to update the code. Note also it looks for everything after the / in that value, so http://fatesharvest.com/w/Green will return Green.
Usage:
+getcast : gets the cast for the room you're in.
+getcast <name> : get the wiki information for a specific person.
If the player does not have their wiki set in their +finger, it'll say "missing".
Output:
______________________________________________________________________________
Scene Cast List for OOC Nexus
[[User:Skew|Flatirons]], [[Logan_Brenner|Logan]], [[Beats|Beatrice]]
______________________________________________________________________________
or
Wiki-Friendly Formatting for AJ: [[AJ_Ray|AJ]]
Here's the code...
// This should go on SGP - Main Globals
&c.get.cast #6=$^\+?getcast(.*)$:@pemit %#=
strcat( setq( 0, secure( %1 )),
switch( %q0,
, u( f.disp.cast.room, loc( %# ), %# ),
%b*, u( f.disp.cast.target, trim( %q0 ), %# ),
It's either something or nothing how did this go wrong?) )
&f.disp.cast.room #6=
strcat(
setq( l, %0 ),
setq( p, %1 ),
u( disp.rainbow ), %r,
center( %xhScene Cast List%xn for %xh[name(%ql)]%xn, 79 ),%r%r,
iter( lcon( %ql, connect ), strcat(
setq( f, last( get( ##/finger-wiki ), / ) ),
setq( w, last( get( ##/wiki ), / ) ),
lit([[),
switch( 1,
t( %qw ), %qw,
t( %qf ), %qf,
%xh%xxMissing%xn),
|, name( ## ), lit(]]) ), , %,%b), %r,
u( disp.rainbow) )
&f.disp.cast.target #6=
strcat(
setq( t, pmatch( %0 ) ),
if( t( %qt),
strcat(
%r, Wiki-Friendly Formatting for %xh[name( %qt )]%xn:, %b,
setq( f, last( get( %qt/finger-wiki ), / ) ),
setq( w, last( get( %qt/wiki ), / ) ),
lit([[),
switch( 1,
t( %qw ), %qw,
t( %qf ), %qf,
%xh%xxMissing%xn),
|, name( %qt ), lit(]]), %r ),
%xh<+getcast>%xn Target must be a player. )
)
&disp.rainbow #6=%r%xx__%xh__%xn%xm__%xh__%xn%xb___%xh___%xn%xc____%xh____%xn%xg_____%xh_____%xn%xx___%xn%xx_%xh_%xn%xm_%xh_%xn%xb_%xh_%xn%xc_%xh_%xn%xh%xx___%xn%xg%xh_____%xn%xg_____%xc%xh____%xn%xc____%xb%xh___%xn%xb___%xm%xh__%xn%xm__%xx%xh__%xn%xx__%xn
@set #6/c.get.cast=regex
That disp.rainbow makes a pretty rainbow line. Feel free to replace u( disp. rainbow ) in the code with header( +getcast ) or whatever you'd like. I liked the rainbow. It's a good rainbow.
And here's the copy+paste:
&c.get.cast #6=$^\+?getcast(.*)$:@pemit %#=strcat( setq( 0, secure( %1 )),switch( %q0,, u( f.disp.cast.room, loc( %# ), %# ),%b*, u( f.disp.cast.target, trim( %q0 ), %# ),It's either something or nothing how did this go wrong?) )
&f.disp.cast.room #6=strcat( setq( l, %0 ),setq( p, %1 ),u( disp.rainbow ), %r,center( %xhScene Cast List%xn for %xh[name(%ql)]%xn, 79 ),%r%r,iter( lcon( %ql, connect ), strcat(setq( f, last( get( ##/finger-wiki ), / ) ),setq( w, last( get( ##/wiki ), / ) ),lit([[),switch( 1,t( %qw ), %qw, t( %qf ), %qf,%xh%xxMissing%xn), |, name( ## ), lit(]]) ), , %,%b), %r,u( disp.rainbow) )
&f.disp.cast.target #6=strcat(setq( t, pmatch( %0 ) ),if( t( %qt),strcat(%r, Wiki-Friendly Formatting for %xh[name( %qt )]%xn:, %b,setq( f, last( get( %qt/finger-wiki ), / ) ),setq( w, last( get( %qt/wiki ), / ) ),lit([[),switch( 1,t( %qw ), %qw, t( %qf ), %qf,%xh%xxMissing%xn), |, name( %qt ), lit(]]), %r ),%xh<+getcast>%xn Target must be a player. ))
&disp.rainbow #6=%r%xx__%xh__%xn%xm__%xh__%xn%xb___%xh___%xn%xc____%xh____%xn%xg_____%xh_____%xn%xx___%xn%xx_%xh_%xn%xm_%xh_%xn%xb_%xh_%xn%xc_%xh_%xn%xh%xx___%xn%xg%xh_____%xn%xg_____%xc%xh____%xn%xc____%xb%xh___%xn%xb___%xm%xh__%xn%xm__%xx%xh__%xn%xx__%xn
@set #6/c.get.cast=regex