Standard Room Parent
A "standard room parent" - players and objects listed in columns, the room name displayed with flag and zone information, and an exit list that displays the exit name and its first alias.
Functions:
and(),
andflags(),
ansi(),
conn(),
controls(),
filter(),
first(),
flags(),
fullname(),
gte(),
hasflag(),
haspower(),
hastype(),
if(),
inc(),
iter(),
lcon(),
left(),
ljust(),
lnum(),
match(),
max(),
name(),
not(),
num(),
or(),
orflags(),
owner(),
rest(),
room(),
setq(),
space(),
strlen(),
sub(),
switch(),
u(),
words(),
zone().
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for Standard Room Parent
@create Standard Room Parent
@lock/Basic Standard Room Parent==me
@lset Standard Room Parent/Basic=no_inherit
@set Standard Room Parent = LINK_OK
@set Standard Room Parent = HALT
@set Standard Room Parent = NO_COMMAND
&CAN_FLAGS Standard Room Parent=and(not(hasflag(%0,MYOPIC)),or(match(owner(%1),%0),hasflag(%0,WIZARD),hasflag(%0,ROYALTY),haspower(%0,See_All),hasflag(%1,Visual),hasflag(%1,Link_Ok),hasflag(%1,Jump_Ok),hasflag(%1,Chown_Ok),hasflag(%1,Destroy_Ok)))
@CONFORMAT Standard Room Parent=if(%0,[ljust(Players:,30)]Objects:[setq(0,filter(IsPlayer,%0))][setq(1,filter(IsThing,%0))][iter(lnum(max(words(%q0),words(%q1))),%r[if(first(%q0),[ljust([ansi(y,name(first(%q0)))][u(Do_Flags,first(%q0))],30)][setq(0,rest(%q0))],space(30))][if(first(%q1),[u(Thing,first(%q1))][setq(1,rest(%q1))])])])
@set Standard Room Parent/CONFORMAT=no_command prefixmatch
&DESCFORMAT Standard Room Parent=ansi(c, u(Describe))
@set Standard Room Parent/DESCFORMAT=no_command visual prefixmatch
&DESCRIBE Standard Room Parent=No room description has been set. The owner of this room can set a description by typing:%r%r[ansi(hm,@desc here=<description>)]
@set Standard Room Parent/DESCRIBE=no_command visual public nearby
&DO_FLAGS Standard Room Parent=if(u(Can_Flags,%#,%0),(%0[flags(%0)]))
@EXITFORMAT Standard Room Parent=if(%0,Obvious exits:%r[iter(%0,[ansi(g,name(##))] [ansi(hg,<[first(rest(fullname(##),;),;)]>)],,%b%b%b)])
@set Standard Room Parent/EXITFORMAT=no_command prefixmatch
&IDESCRIBE Standard Room Parent=[ansi(c,u(RDesc))]
@set Standard Room Parent/IDESCRIBE=no_command visual prefixmatch
&ISPLAYER Standard Room Parent=hastype(%0,Player)
&ISTHING Standard Room Parent=hastype(%0,Thing)
@NAMEFORMAT Standard Room Parent=[ansi(h,if(zone(me), \[[name(zone(me))]\]%b)[name(me)])][if(or(controls(%#, me), hasflag(%#, Royalty), haspower(%#, See_All), orflags(me,VJLAd)), (%![flags(me)]))]
@set Standard Room Parent/NAMEFORMAT=no_command prefixmatch
&OCCUPANTS Standard Room Parent=if(andflags(%0,e!O),setq(3,0)[iter(lcon(%0),if(and(gte(conn(owner(##)),0),or(hastype(##,Player),hasflag(##,Puppet))),setq(3,inc(%q3))),,)][if(%q3,%b([switch(%q3,1,1 occupant,%q3 occupants)]))])
&THING Standard Room Parent=[setq(2,u(Do_Flags,%0)[u(Occupants,%0)])][ansi(m,left(name(%0),sub(48,strlen(%q2))))]%q2
think @parent your room(s) to [num(Standard Room Parent)]
@lock/Basic Standard Room Parent==me
@lset Standard Room Parent/Basic=no_inherit
@set Standard Room Parent = LINK_OK
@set Standard Room Parent = HALT
@set Standard Room Parent = NO_COMMAND
&CAN_FLAGS Standard Room Parent=and(not(hasflag(%0,MYOPIC)),or(match(owner(%1),%0),hasflag(%0,WIZARD),hasflag(%0,ROYALTY),haspower(%0,See_All),hasflag(%1,Visual),hasflag(%1,Link_Ok),hasflag(%1,Jump_Ok),hasflag(%1,Chown_Ok),hasflag(%1,Destroy_Ok)))
@CONFORMAT Standard Room Parent=if(%0,[ljust(Players:,30)]Objects:[setq(0,filter(IsPlayer,%0))][setq(1,filter(IsThing,%0))][iter(lnum(max(words(%q0),words(%q1))),%r[if(first(%q0),[ljust([ansi(y,name(first(%q0)))][u(Do_Flags,first(%q0))],30)][setq(0,rest(%q0))],space(30))][if(first(%q1),[u(Thing,first(%q1))][setq(1,rest(%q1))])])])
@set Standard Room Parent/CONFORMAT=no_command prefixmatch
&DESCFORMAT Standard Room Parent=ansi(c, u(Describe))
@set Standard Room Parent/DESCFORMAT=no_command visual prefixmatch
&DESCRIBE Standard Room Parent=No room description has been set. The owner of this room can set a description by typing:%r%r[ansi(hm,@desc here=<description>)]
@set Standard Room Parent/DESCRIBE=no_command visual public nearby
&DO_FLAGS Standard Room Parent=if(u(Can_Flags,%#,%0),(%0[flags(%0)]))
@EXITFORMAT Standard Room Parent=if(%0,Obvious exits:%r[iter(%0,[ansi(g,name(##))] [ansi(hg,<[first(rest(fullname(##),;),;)]>)],,%b%b%b)])
@set Standard Room Parent/EXITFORMAT=no_command prefixmatch
&IDESCRIBE Standard Room Parent=[ansi(c,u(RDesc))]
@set Standard Room Parent/IDESCRIBE=no_command visual prefixmatch
&ISPLAYER Standard Room Parent=hastype(%0,Player)
&ISTHING Standard Room Parent=hastype(%0,Thing)
@NAMEFORMAT Standard Room Parent=[ansi(h,if(zone(me), \[[name(zone(me))]\]%b)[name(me)])][if(or(controls(%#, me), hasflag(%#, Royalty), haspower(%#, See_All), orflags(me,VJLAd)), (%![flags(me)]))]
@set Standard Room Parent/NAMEFORMAT=no_command prefixmatch
&OCCUPANTS Standard Room Parent=if(andflags(%0,e!O),setq(3,0)[iter(lcon(%0),if(and(gte(conn(owner(##)),0),or(hastype(##,Player),hasflag(##,Puppet))),setq(3,inc(%q3))),,)][if(%q3,%b([switch(%q3,1,1 occupant,%q3 occupants)]))])
&THING Standard Room Parent=[setq(2,u(Do_Flags,%0)[u(Occupants,%0)])][ansi(m,left(name(%0),sub(48,strlen(%q2))))]%q2
think @parent your room(s) to [num(Standard Room Parent)]