Personal "Who" Device

This is a personal "who" device. You use this to see if your friends or enemies are on, without having to search through the whole WHO list.

Category: Other
Compatibility: CobraMUSH, PennMUSH, TinyBit, TinyMUSH, TinyMUX.

Instructions

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

MUSHCode for Personal "Who" Device

This is a personal "who" device. You use this to see if your friends
or enemies are on, without having to search through the whole WHO
list.

--- Taisch, 16-December-1999

=================================================================

@create pwho

@lock pwho=me

@lock/use pwho=me

@Desc pwho=A personal who lister.

@Adesc pwho=@pemit %#=[switch(owner(me),%#,Type 'pwho/help' for commands,)]

@set pwho=DARK

@set pwho=COMMANDS

&CMD-HELP pwho=$pwho/help:@pemit %#=[center(Pwho commands:,79,=)]%r[u(text-help)]%r[repeat(=,79)]

&CMD-WHOSON pwho=$pwho:@pemit %#=[u(xheader)]%r [u(xlister)][repeat(=,79)]

&CMD-WHOALL pwho=$pwho/all:@pemit %#=[u(xheader0)]%r [u(xlistall)][repeat(=,79)]

&CMD-ADD pwho=$pwho/add *:@switch [type(*%0)]=player,{@pemit %#=[name(*%0)] added to your who list.;&list-who me=[setunion(v(list-who),num(*%0))];},{@pemit %#=That is not a player.}

&CMD-REM pwho=$pwho/rem *:@pemit %#=Removing [name(num(*%0))] from the who list.;&list-who me=[ldelete(v(list-who),member(v(list-who),[num(*%0)]))];

&CMD-WHOALLSHORT pwho=$pwho/alls:@pemit %#=[iter(v(list-who),[name(##)] <##> = )]

&CMD-CLEARLIST pwho=$pwho/clear:@pemit %#=Wiping non-players.;&list-who me=[s(iter(get(me/list-who),switch(type(##),player,##,)))];

&XHEADER pwho=[center(Who's on:,79,=)]%r[ljust(Name,15)][rjust(Idle/Connect,15)][rjust(Location,35)]%r[repeat(-,79)]

&XHEADER0 pwho=[center(Everyone:,79,=)]%r[ljust(Name,15)][rjust(Idle/Connect/Last login,25)][rjust(Location,35)]%r[repeat(-,79)]

&XLISTER pwho=s(iter(v(list-who),switch(hasflag(##,connect),1,[ljust(name(##),22,.)][rjust(u(sec-conv,idle(##)),5,.)][rjust(u(sec-conv,conn(##)),5,.)][rjust(mid(switch(hasflag(##,unfindable),1,Unfindable,name(room(##))),0,40),40,.)]%r,)))

&XLISTALL pwho=s(iter(v(list-who),[ljust(name(##)<##>,20,.)][switch(hasflag(##,connect),1,[rjust(u(sec-conv,idle(##)),5,.)][rjust(u(sec-conv,conn(##)),5,.)][repeat(.,18)],[rjust(mid(get(##/last),0,28),28,.)])][rjust(switch(hasflag(##,unfindable),1,Unfindable,[mid(name(room(##)),0,25)]),28,.)]%r))

&SEC-CONV pwho=switch(gt(%0,3600),1,div(%0,3600)h,switch(gt(%0,60),1,div(%0,60)m,%0s))

&TEXT-HELP pwho=pwho/help --- shows this text%rpwho --- shows you who's connected%rpwho/all --- shows you everyone on your list%rpwho/alls --- terse (short) listing of everyone on the list%rpwho/add <player> --- adds <player> to your list%rpwho/rem <player> --- removes <player> from your list%rpwho/clear --- clears non-players off your list%r[repeat(-,79)]%rCoded by Tai@DM