Ariel's Standard Room Parent
A room parent that accounts for day/night based upon the current time.
Functions:
and(),
andflags(),
ansi(),
center(),
conn(),
etimefmt(),
extract(),
first(),
flags(),
fullname(),
get(),
gte(),
hasflag(),
haspower(),
hastype(),
idle(),
if(),
inc(),
inum(),
iter(),
lcon(),
left(),
ljust(),
lt(),
lvplayers(),
lvthings(),
match(),
mod(),
name(),
not(),
or(),
owner(),
remove(),
repeat(),
rest(),
setq(),
setr(),
space(),
strlen(),
sub(),
subj(),
switch(),
time(),
u(),
udefault().
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for Ariel's Standard Room Parent
@create Ariel's Standard Room Parent
@link Ariel's Standard Room Parent=here
@lock Ariel's Standard Room Parent=me
@set Ariel's Standard Room Parent=LINK_OK
@set Ariel's Standard Room Parent=VISUAL
@set Ariel's Standard Room Parent=WIZARD
@set Ariel's Standard Room Parent=NO_WARN
@set Ariel's Standard Room Parent=NO_COMMAND
&CAN_FLAGS Ariel's 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 Ariel's Standard Room Parent=[ansi(c,[center(---< [ansi(y,Players)] >---,78,-)])]%R[iter(lvplayers(me),[space(1)][ansi(y,[ljust(left(name(##),19),19)])] [ljust(ansi(c,left(u(##/short-desc),39)),36)] [ansi(y,[ljust(etimefmt($2xzd $2xzh $2xzm $2zxs,idle(##)),12)][space(01)][ljust(ansi(c,left(u(##/status_room),39)),1)])],,%R)]%R[ansi(c,[center(---< [ansi(y,Objects)] >---,78,-)])][iter(lvthings(me),%r[space(31)][ansi(y,[ljust(left(name(##),47),25)])][if(not(mod(inum(0),319)),%R)],,)]
@set Ariel's Standard Room Parent/CONFORMAT=wizard
&DAYDESC Ariel's Standard Room Parent=%rNo room description has been set. The owner of this room can set a description by typing: [ansi(hg,&daydesc)] [ansi(y,room/object/exit)][ansi(hg,=)][ansi(y,description)].%r%rTo properly name your room\, and have it display it's name and number\, type [ansi(hg,&ANSI_NAME here=\%r\[ansi\(c\,)][ansi(y,Name Of Room)][ansi(hg,\)\]\[ansi\(y\,\\(\[room\(me\)\]\[flags(me\)\]\\)\)\].%r
&DAYIDESC Ariel's Standard Room Parent=%rNo idesc description has been set. The owner of this room can set an idescription by typing: [ansi(hg,&dayidesc)] [ansi(y,room/object/exit)][ansi(hg,=)][ansi(y,description)].%r%rTo properly name your room\, and have it display it's name and number\, type [ansi(hg,&ANSI_NAME here=\%r\[ansi\(c\,)][ansi(y,Name Of Room)][ansi(hg,\)\]\[ansi\(y\,\\(\[room\(me\)\]\[flags(me\)\]\\)\)\].%r
&DESCRIBE Ariel's Standard Room Parent=switch(and(gte(setr(1,extract(extract(time(),4,1),1,1,:)),6),lt(%q1,18)),1,%r[ansi(c,[repeat(-,78)])]%r[ansi(c,u(daydesc))],[ansi(c,[repeat(-,78)])]%r[ansi(y,u(nightdesc))]
@set Ariel's Standard Room Parent/DESCRIBE=wizard
&DO_FLAGS Ariel's Standard Room Parent=if(u(Can_Flags,%#,%0),(%0[flags(%0)]))
&EXITFORMAT Ariel's Standard Room Parent=[ansi(c,[center(---< [ansi(y,Exits)] >---,78,-)])]%r[iter(%0,[ansi(g,name(##))] [ansi(hg,<[first(rest(fullname(##),;),;)]>)],,%b%b%b)]%r[ansi(c,[repeat(-,78)])]%r
@set Ariel's Standard Room Parent/EXITFORMAT=no_command prefixmatch
&IDESCRIBE Ariel's Standard Room Parent=switch(and(gte(setr(1,extract(extract(time(),4,1),1,1,:)),6),lt(%q1,18)),1,%r[ansi(c,[repeat(-,78)])]%r[ansi(c,u(dayidesc))],[ansi(c,[repeat(-,78)])]%r[ansi(y,u(nightidesc))]
@set Ariel's Standard Room Parent/IDESCRIBE=no_command prefixmatch
&ISPLAYER Ariel's Standard Room Parent=hastype(%0,Player)
&ISTHING Ariel's Standard Room Parent=hastype(%0,Thing)
&NAMEFORMAT Ariel's Standard Room Parent=[udefault(%0/ansi_name, %1)]
@set Ariel's Standard Room Parent/NAMEFORMAT=no_command prefixmatch
&NIGHTDESC Ariel's Standard Room Parent=%rNo room description has been set. The owner of this room can set a description by typing: [ansi(hg,&nightdesc)] [ansi(c,room/object/exit)][ansi(hg,=)][ansi(c,description)].%r%rTo properly name your room\, and have it display it's name and number\, type [ansi(hg,&ANSI_NAME here=\%r\[ansi\(c\,)][ansi(c,Name Of Room)][ansi(hg,\)\]\[ansi\(y\,\\(\[room\(me\)\]\[flags(me\)\]\\)\)\].%r
&NIGHTIDESC Ariel's Standard Room Parent=%rNo idesc description has been set. The owner of this room can set an idescription by typing: [ansi(hg,&nightidesc)] [ansi(c,room/object/exit)][ansi(hg,=)][ansi(c,description)].%r%rTo properly name your room\, and have it display it's name and number\, type [ansi(hg,&ANSI_NAME here=\%r\[ansi\(c\,)][ansi(c,Name Of Room)][ansi(hg,\)\]\[ansi\(y\,\\(\[room\(me\)\]\[flags(me\)\]\\)\)\].%r
&OCCUPANTS Ariel's Standard Room Parent=if(andflags(%0,e!O),setq(3,0)[iter(remove(lcon(%0), #-1) ,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)]))])
&OENTER Ariel's Standard Room Parent=[ansi(g,%n)] [ansi(c,has arrived.)]
@set Ariel's Standard Room Parent/OENTER=no_command prefixmatch noname
&OLEAVE Ariel's Standard Room Parent=[ansi(g,%n)] [ansi(y,has left.)]
@set Ariel's Standard Room Parent/OLEAVE=no_command prefixmatch noname
&THING Ariel's Standard Room Parent=[setq(2,u(Do_Flags,%0)[u(Occupants,%0)])][ansi(m,left(name(%0),sub(48,strlen(%q2))))]%q2
&_FN_RACE Ariel's Standard Room Parent=[if(get(%0/Race),%b[ansi(hg,([switch(subj(%0),he,Male,she,Female,shi,Herm,shem,Shemale,unknown,Unknown)] [get(%0/Race)]))])]
@set Ariel's Standard Room Parent/_FN_RACE=visual
@link Ariel's Standard Room Parent=here
@lock Ariel's Standard Room Parent=me
@set Ariel's Standard Room Parent=LINK_OK
@set Ariel's Standard Room Parent=VISUAL
@set Ariel's Standard Room Parent=WIZARD
@set Ariel's Standard Room Parent=NO_WARN
@set Ariel's Standard Room Parent=NO_COMMAND
&CAN_FLAGS Ariel's 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 Ariel's Standard Room Parent=[ansi(c,[center(---< [ansi(y,Players)] >---,78,-)])]%R[iter(lvplayers(me),[space(1)][ansi(y,[ljust(left(name(##),19),19)])] [ljust(ansi(c,left(u(##/short-desc),39)),36)] [ansi(y,[ljust(etimefmt($2xzd $2xzh $2xzm $2zxs,idle(##)),12)][space(01)][ljust(ansi(c,left(u(##/status_room),39)),1)])],,%R)]%R[ansi(c,[center(---< [ansi(y,Objects)] >---,78,-)])][iter(lvthings(me),%r[space(31)][ansi(y,[ljust(left(name(##),47),25)])][if(not(mod(inum(0),319)),%R)],,)]
@set Ariel's Standard Room Parent/CONFORMAT=wizard
&DAYDESC Ariel's Standard Room Parent=%rNo room description has been set. The owner of this room can set a description by typing: [ansi(hg,&daydesc)] [ansi(y,room/object/exit)][ansi(hg,=)][ansi(y,description)].%r%rTo properly name your room\, and have it display it's name and number\, type [ansi(hg,&ANSI_NAME here=\%r\[ansi\(c\,)][ansi(y,Name Of Room)][ansi(hg,\)\]\[ansi\(y\,\\(\[room\(me\)\]\[flags(me\)\]\\)\)\].%r
&DAYIDESC Ariel's Standard Room Parent=%rNo idesc description has been set. The owner of this room can set an idescription by typing: [ansi(hg,&dayidesc)] [ansi(y,room/object/exit)][ansi(hg,=)][ansi(y,description)].%r%rTo properly name your room\, and have it display it's name and number\, type [ansi(hg,&ANSI_NAME here=\%r\[ansi\(c\,)][ansi(y,Name Of Room)][ansi(hg,\)\]\[ansi\(y\,\\(\[room\(me\)\]\[flags(me\)\]\\)\)\].%r
&DESCRIBE Ariel's Standard Room Parent=switch(and(gte(setr(1,extract(extract(time(),4,1),1,1,:)),6),lt(%q1,18)),1,%r[ansi(c,[repeat(-,78)])]%r[ansi(c,u(daydesc))],[ansi(c,[repeat(-,78)])]%r[ansi(y,u(nightdesc))]
@set Ariel's Standard Room Parent/DESCRIBE=wizard
&DO_FLAGS Ariel's Standard Room Parent=if(u(Can_Flags,%#,%0),(%0[flags(%0)]))
&EXITFORMAT Ariel's Standard Room Parent=[ansi(c,[center(---< [ansi(y,Exits)] >---,78,-)])]%r[iter(%0,[ansi(g,name(##))] [ansi(hg,<[first(rest(fullname(##),;),;)]>)],,%b%b%b)]%r[ansi(c,[repeat(-,78)])]%r
@set Ariel's Standard Room Parent/EXITFORMAT=no_command prefixmatch
&IDESCRIBE Ariel's Standard Room Parent=switch(and(gte(setr(1,extract(extract(time(),4,1),1,1,:)),6),lt(%q1,18)),1,%r[ansi(c,[repeat(-,78)])]%r[ansi(c,u(dayidesc))],[ansi(c,[repeat(-,78)])]%r[ansi(y,u(nightidesc))]
@set Ariel's Standard Room Parent/IDESCRIBE=no_command prefixmatch
&ISPLAYER Ariel's Standard Room Parent=hastype(%0,Player)
&ISTHING Ariel's Standard Room Parent=hastype(%0,Thing)
&NAMEFORMAT Ariel's Standard Room Parent=[udefault(%0/ansi_name, %1)]
@set Ariel's Standard Room Parent/NAMEFORMAT=no_command prefixmatch
&NIGHTDESC Ariel's Standard Room Parent=%rNo room description has been set. The owner of this room can set a description by typing: [ansi(hg,&nightdesc)] [ansi(c,room/object/exit)][ansi(hg,=)][ansi(c,description)].%r%rTo properly name your room\, and have it display it's name and number\, type [ansi(hg,&ANSI_NAME here=\%r\[ansi\(c\,)][ansi(c,Name Of Room)][ansi(hg,\)\]\[ansi\(y\,\\(\[room\(me\)\]\[flags(me\)\]\\)\)\].%r
&NIGHTIDESC Ariel's Standard Room Parent=%rNo idesc description has been set. The owner of this room can set an idescription by typing: [ansi(hg,&nightidesc)] [ansi(c,room/object/exit)][ansi(hg,=)][ansi(c,description)].%r%rTo properly name your room\, and have it display it's name and number\, type [ansi(hg,&ANSI_NAME here=\%r\[ansi\(c\,)][ansi(c,Name Of Room)][ansi(hg,\)\]\[ansi\(y\,\\(\[room\(me\)\]\[flags(me\)\]\\)\)\].%r
&OCCUPANTS Ariel's Standard Room Parent=if(andflags(%0,e!O),setq(3,0)[iter(remove(lcon(%0), #-1) ,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)]))])
&OENTER Ariel's Standard Room Parent=[ansi(g,%n)] [ansi(c,has arrived.)]
@set Ariel's Standard Room Parent/OENTER=no_command prefixmatch noname
&OLEAVE Ariel's Standard Room Parent=[ansi(g,%n)] [ansi(y,has left.)]
@set Ariel's Standard Room Parent/OLEAVE=no_command prefixmatch noname
&THING Ariel's Standard Room Parent=[setq(2,u(Do_Flags,%0)[u(Occupants,%0)])][ansi(m,left(name(%0),sub(48,strlen(%q2))))]%q2
&_FN_RACE Ariel's Standard Room Parent=[if(get(%0/Race),%b[ansi(hg,([switch(subj(%0),he,Male,she,Female,shi,Herm,shem,Shemale,unknown,Unknown)] [get(%0/Race)]))])]
@set Ariel's Standard Room Parent/_FN_RACE=visual