Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
199 lines (150 sloc) 9.22 KB
@@ Faraday's Who System
@@ Website: http://www.aresmush.com/
@@
@@ Visit the website for documentation, installation instructions, bug reports,
@@ and more.
@set me=QUIET
@pemit/silent %#=[ansi(hg,Beginning Who System Installation. Please wait until you see the 'Installation Complete' message...)]%R
@pemit/silent %#=[ansi(hg,Creating Objects...)]%R
think install_create(WHO_CMD,Who Commands,1,0,8.2,Configurable Who system.)
think install_create(WHO_FUN,Who Functions,1,1,8.2,Functions for the Who system.)
think install_create(WHO_DB,Who Data,1,1,8.2,Data storage for the Who system.)
@pemit/silent %#=[ansi(hg,Setting Up Object Attributes...)]%R
&CMD-+WHO Who Commands=$+who:think pemit(%#,u(#WHO_FUN/fun_who,who))
&CMD-WHO Who Commands=$who:think pemit(%#,u(#WHO_FUN/fun_who,who))
&CMD-+WHERE Who Commands=$+where:think pemit(%#,u(#WHO_FUN/fun_who,where))
&CMD-+WHO-AGE Who Commands=$+who/age:think pemit(%#,[line()]%R[ansi(h,Top 25 Oldest Characters)]%R[setq(0,extract(sort(iter(real_players(),switch(hasflag(##,?),1,%q0,%q0 [convtime(ctime(##))]:##))),1,25))][iter(%q0,%R[ljust(#@.,3)] [name(after(##,:))] - [convsecs(before(##,:))])]%R[line()])
@aconnect Who Commands=think [switch(gt(words(mwho()),xget(#WHO_DB,who_record)),1,[set(#WHO_DB,who_record:[words(mwho())])][pemit(lwho(),[ansi(h[rand_color()],<OOC> New Online Record - [words(mwho())] players!)])])]
&HELP_+WHERE Who Functions=[ansi(h,+where)] is a general command to list connected players. It shows their current locations, idle time, and whether they are available for RP. Information on player locations is only to be used OOCly. Do not go somewhere unless your character has a reason to go there, no matter who might be at that location. Even if your character does have a reason to wander by, be courteous and ask the other players in a location if they mind you joining in. You can hide your location in +who by typing @set me=Unfindable.
&HELP_+WHO Who Functions=[ansi(h,+who)] is a general command to list connected players and their positions.%R%RIn addition to showing who's currently online, the +who command keeps track of the MUSH's oldest players (those who have been playing the longest). You can view this through the [ansi(h,+who/age)] command.
&SHELP_+WHO Who Functions=There is a lot to configure in the who system. See the wiki for details: http://www.aresmush.com/
@@ --------------------------
@@ FUN_FOLD_RPOK
@@ Intended to be called via fold() to count the number of players who are RPOK
@@ %0 = running count of RPOK peeps
@@ %1 = the next person to check if they're RPOK
@@ --------------------------
&FUN_FOLD_RPOK Who Functions=add(%0,u(FUN_IS_IC,%1))
@@ --------------------------
@@ FUN_SORT_AGE
@@ Sortby function to sort people by created time.
@@ %0/%1 = Two players to compare
@@ --------------------------
&FUN_SORT_AGE Who Functions=switch(1,eq(convtime(ctime(%0)),convtime(ctime(%1))),0,gt(convtime(ctime(%0)),convtime(ctime(%1))),1,-1)
@@ --------------------------
@@ FUN_WHO
@@ Master function for displaying +who/+where
@@ %0 = who or where
@@ --------------------------
&FUN_WHO Who Functions=[u(#WHO_DB/TOP_LINE)]%R[u(#WHO_DB/HEADER)][u(FUN_TITLES,%0)]%R[u(#WHO_DB/SEPARATOR_LINE)][iter(sortby(#WHO_DB/FUN_SORT_%0,u(FUN_VISIBLE_PLAYERS)),u(FUN_WHO_LINE,%0,##))]%R[u(#WHO_DB/SEPARATOR_LINE)]%R[u(#WHO_DB/FOOTER)]%R[u(#WHO_DB/BOTTOM_LINE)]
@@ --------------------------
@@ FUN_WHO_LINE
@@ Displays a single player entry for +who/+where
@@ %0 = who or where
@@ %1 = the current player
@@ --------------------------
&FUN_WHO_LINE Who Functions=%R[u(#WHO_DB/left_border)]%B[iter(xget(#WHO_DB,%0_FIELDS),padstr(u(#WHO_DB/[before(##,:)],%1),after(##,:)))]%B[u(#WHO_DB/right_border)]
@@ --------------------------
@@ FUN_TITLES
@@ Displays the titles for the columns, if they've been configured.
@@ %0 = who or where
@@ --------------------------
&FUN_TITLES Who Functions=[switch(t(xget(#WHO_DB,%0_TITLES)),0,,%R[u(#WHO_DB/left_border)]%B[ansi(h,iter(xget(#WHO_DB,%0_FIELDS),padstr(extract(xget(#WHO_DB,%0_TITLES),#@,1,|),after(##,:))))]%B[u(#WHO_DB/right_border)])
@@ --------------------------
@@ FUN_ONLINE_SUMMARY
@@ Displays a summary of folks online, RPOK and the Who record
@@ %0 = available space. Divided into 3 equal columns, which are then centered into the total available space.
@@ --------------------------
&FUN_ONLINE_SUMMARY Who Functions=center([ljust(ansi(m,%B[words(u(FUN_VISIBLE_PLAYERS))] Online),div(%0,3))][center(ansi(r,[fold(FUN_FOLD_RPOK,mwho(),0)] IC),div(%0,3))][rjust(ansi(g,[xget(#WHO_DB,who_record)] Record%B),div(%0,3))],%0)
@@ --------------------------
@@ FUN_VISIBLE_PLAYERS
@@ Uses lwho or mwho depending on whether the enactor is staff/mortal
@@ --------------------------
&FUN_VISIBLE_PLAYERS Who Functions=switch(isstaff(%#),1,lwho(),mwho())
@@ --------------------------
@@ FUN_IS_IN_TPROOM
@@ Is the player in a TP Room.
@@ %0 = player
@@ --------------------------
&FUN_IS_IN_TPROOM Who Functions=switch(xget(#WHO_DB,TP_ROOM_PARENT),#-1,0,match(parent(loc(%0)),xget(#WHO_DB,TP_ROOM_PARENT)))
@@ --------------------------
@@ FUN_IS_IC
@@ Player is IC if they're status is IC or they're in a TP Room
@@ %0 = player
@@ --------------------------
&FUN_IS_IC Who Functions=or(switch(xget(%0,status),IC,1,0),u(FUN_IS_IN_TPROOM,%0))
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ ***** DATA SECTION *****
@@ ***** CHECK BEFORE UPGRADING *****
@@ ***** REMOVE OF MODIFY AS NEEDED *****
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ --------------------------
@@ FUN_SORT_WHO and FUN_SORT_WHERE
@@ Sort functions for the +who/+where lists
@@ %0 and %1 = two players to compare
@@ --------------------------
&FUN_SORT_WHO Who Data=[comp(xget(%0,faction),xget(%1,faction))]
&FUN_SORT_WHERE Who Data=[comp([xget(loc(%0),area)] [name(loc(%0))],[xget(loc(%1),area)] [name(loc(%1))])]
@@ --------------------------
@@ CENTER_AREA
@@ The amount of room left over in the middle after accounting for the left and right borders
@@ --------------------------
&CENTER_AREA Who Data=sub(78,add(strlen(u(LEFT_BORDER)),strlen(u(RIGHT_BORDER))))
&COLOR Who Data=rand_color()
&MUSH_NAME Who Data=[ansi(hr,MY MUSH)]
&WHO_RECORD Who Data=1
&TP_ROOM_PARENT Who Data=#-1
&TOP_LINE Who Data=[ansi(u(COLOR),line_no_color())]
&BOTTOM_LINE Who Data=[ansi(u(COLOR),line_no_color())]
&SEPARATOR_LINE Who Data=[u(LEFT_BORDER)][repeat(-,u(center_area))][u(RIGHT_BORDER)]
&HEADER Who Data=[u(LEFT_BORDER)][center(u(MUSH_NAME),u(center_area))][u(RIGHT_BORDER)]
&FOOTER Who Data=[u(LEFT_BORDER)][u(#WHO_FUN/FUN_ONLINE_SUMMARY,u(center_area))][u(RIGHT_BORDER)]
&LEFT_BORDER Who Data=[ansi(u(COLOR),==-)]
&RIGHT_BORDER Who Data=[ansi(u(COLOR),-==)]
@@ --------------------------
@@ Standard fields that CAN appear in +who/+where.
@@ You're welcome to define your own.
@@
@@ %0 = player
@@ --------------------------
@@ IC/OOC/AFK/NEW/STF status
&STATUS Who Data=switch(1,match(loc(%0),v(IDLE_LOUNGE)),[ansi(hx,AFK)],isstaff(%0),[ansi(hb,STF)],u(#WHO_FUN/FUN_IS_IN_TPROOM,%0),[ansi(hm,IC)]%B,match(xget(%0,status),NEW),[ansi(hg,NEW)],match(xget(%0,status),IC),switch(xget(%0,rpsearch),1,[ansi(hR,IC)]%B,[ansi(hr,IC)]%B),[ansi(h,OOC)])
&NAME Who Data=name(%0)
@@ 'Room Name - Room Area', or 'Unfindable' if the player or their room is set Unfindable
&LOCATION Who Data=switch(or(hasflag(%0,unfindable),hasflag(loc(%0),unfindable)),1,UNFINDABLE,[name(loc(%0))] [switch(xget(loc(%0),area),,,- [xget(loc(%0),area)])]
&RANK Who Data=rank(%0)
&POSITION Who Data=xget(%0,position)
@@ Just puts rank and position next to each other
&RANKANDPOS Who Data=localize([setq(0,u(rank,%0))][switch(%q0,,u(position,%0),%q0 - [u(position,%0)])])
&IDLETIME Who Data=first(timestring(idlesecs(%0)))
&FACTION Who Data=xget(%0,faction)
@@ --------------------------
@@ Selects which fields ARE displayed in who/where
@@ Fields are listed like fieldattribute:length
@@ - length is passed to padstr() to pad or trim as needed
@@ --------------------------
&WHO_FIELDS Who Data=Status:5 Name:15 Faction:12 RankAndPos:30 IdleTime:4
&WHERE_FIELDS Who Data=Status:5 Name:20 Location:38 IdleTime:4
@@ --------------------------
@@ Defines titles for the columns in the who/where display.
@@ Leave blank if you don't want titles.
@@ Separate titles by pipes |
@@ --------------------------
&WHO_TITLES Who Data=|Name|Faction|Rank/Position|Idle
&WHERE_TITLES Who Data=
@wait 6=+jobs/create CODE=Who/Configure the +who system. See +shelp +who.
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ ***** END DATA SECTION *****
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@pemit/silent %#=[ansi(hg,Setting up database numbers...)]%R
@wait 2=+install/updategroup WHO
@wait 5=@pemit/silent %#=%R%R[ansi(hg,Installation Complete!!)]
@wait 5=@set me=!quiet