Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 111 lines (85 sloc) 14.8 KB
@@ Faraday's +finger 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 +finger Installation. Please wait until you see the 'Installation Complete' message...)]%R
@pemit/silent %#=[ansi(hg,Creating Objects...)]%R
think install_create(FINGER_CMD,+finger Commands,1,0,8.2,+finger commands.)
think install_create(FINGER_FUN,+finger Functions,1,1,8.2,+finger functions.)
think install_create(FINGER_DB,+finger Database,1,1,8.2,+finger data storage.)
&CMD-+FINGER +finger Commands=$+finger *:think pemit(%#,switch(0,t(pmatch(%0)),ansi(hr,There is no such player.),u(#FINGER_FUN/fun_show_finger,pmatch(%0),1)))
&CMD-+FINGER-BRIEF +finger Commands=$+finger/brief *:think pemit(%#,switch(0,t(pmatch(%0)),ansi(hr,There is no such player.),u(#FINGER_FUN/fun_show_finger,pmatch(%0),0)))
@STARTUP +finger Commands=@set me=!NO_COMMAND
&FUN_ALIGN_LEFT_FIELD +finger Functions=[switch(xget(#FINGER_DB,left_align),left,ljust,right,rjust,center)](mid(%0,0,%1),%1)
&FUN_ALIGN_RIGHT_FIELD +finger Functions=[switch(xget(#FINGER_DB,right_align),left,ljust,right,rjust,center)](mid(%0,0,%1),%1)
&FUN_GET_LEFT_SPACE +finger Functions=sub(sub(sub(39,strlen(u(#FINGER_DB/left_divider))),div(strlen(u(#FINGER_DB/center_divider)),2)),mod(strlen(u(#FINGER_DB/center_divider)),2))
&FUN_GET_RIGHT_SPACE +finger Functions=sub(sub(39,strlen(u(#FINGER_DB/right_divider))),div(strlen(u(#FINGER_DB/center_divider)),2))
&FUN_SHOW_FINGER +finger Functions=[line()][iter(xget(#FINGER_DB,top_fields),[switch(xget(#FINGER_DB,break_top_fields),1,%r)][u(#FINGER_DB/##,%0)])][switch(gt(max(words(xget(#FINGER_DB,left_fields)),words(xget(#FINGER_DB,right_fields))),0),1,iter(switch(max(words(xget(#FINGER_DB,left_fields)),words(xget(#FINGER_DB,right_fields))),1,1,repeat(|,sub(max(words(xget(#FINGER_DB,left_fields)),words(xget(#FINGER_DB,right_fields))),1))),%R[u(#FINGER_DB/left_divider)][u(#FINGER_FUN/fun_align_left_field,u(#FINGER_DB/[extract(xget(#FINGER_DB,left_fields),#@,1)],%0),u(#FINGER_FUN/fun_get_left_space))][u(#FINGER_DB/center_divider)][u(#FINGER_FUN/fun_align_right_field,u(#FINGER_DB/[extract(xget(#FINGER_DB,right_fields),#@,1)],%0),u(#FINGER_FUN/fun_get_right_space))][u(#FINGER_DB/right_divider)],|))][switch(%1,1,iter(xget(#FINGER_DB,bottom_fields),[switch(xget(#FINGER_DB,break_bottom_fields),1,%r)][u(#FINGER_DB/##,%0)]))]%R[line()][switch(xget(%0,afinger),1,pemit(%0,ansi(g,<OOC> %N just +fingered you.)))]
&MORE_SHELP_+FINGER_CONFIG +finger Functions=All +finger config data is stored on a single object, which should have been created (with default values, on object #FINGER_DB) when you first installed this system.%R%RTo set up your +finger display, you must first decide which fields will appear in which sections. The fields are described in [ansi(h,+shelp +finger_config3)].%R%RThere are four sections: top, left, right, and bottom. If you used all four sections, your display would look like:%R%B%B%B%BTOP%RLEFT%B%B%BRIGHT%R%B%BBOTTOM%Rbut you don't have to use them all. You could have all your fields in the top, and not even show the middle or bottom at all.%R%RNote that most fields (excluding ones like Name and Alias which apply to all players) will automatically disappear if the player does not have the attribute set. In other words you won't see "Awards: <empty>" you'll just see nothing at all.%R%RSet up four attributes: TOP_FIELDS LEFT_FIELDS RIGHT_FIELDS BOTTOM_FIELDS on your finger database object. In each attribute, list which fields you want to show in that section. For example: &top_fields #FINGER_DB=NAME ALIAS RACE, &bottom_fields #FINGER_DB=NOTES%R%R[ansi(h,Continued in +shelp +finger_config2)]
&MORE_SHELP_+FINGER_CONFIG2 +finger Functions=[ansi(r,Special Fields)]%RThere are a couple special attributes on the fingerDB which are not fields per-se but which affect the display:%R%RLEFT_ALIGN - Set this to LEFT RIGHT or CENTER to determine the justification/alignment of the left section.%RRIGHT_ALIGN - same as LEFT_ALIGN but for the right%RLEFT_DIVIDER - Set this to a string (maybe === or ==-) if you want a border on the left side of your left section. The length of the left fields will be trimmed accordingly. You can leave it blank for no border.%RRIGHT_DIVIDER - Set this to a string (maybe === or ==-) if you want a border on the right side of your right section. The length of the right fields will be trimmed accordingly. You can leave it blank for no border.%RCENTER_DIVIDER - Set this to divide the right and left sections. It is recommended that you at the very least set this to a blank space, if not an actual string (maybe --). The length of the right and left fields will be trimmed accordingly.%RENABLE_EVAL - Set this to a 1 if you want characters to be able to evaluate functions in their notes/concept/background attribute (such as for ansi or linebreaks). Set it to 0 if you do not trust PennMUSH's security (+finger is usually pretty safe on Penn, in my experience) or run on MUX or TinyMUSH.%RBREAK_TOP_FIELDS - Set to 1 to automatically put a linebreak between each field in the top section. Set to a 0 if you want to embedd \%r's inside your top fields to separate them.%RBREAK_BOTTOM_FIELDS - same as break top, but for the bottom section%R%R[ansi(h,Continued in +shelp +finger_config3)]
&MORE_SHELP_+FINGER_CONFIG3 +finger Functions=[ansi(r,Finger Fields)]%R%RThese are the basic fields included in the +finger system automatically.%RNAME_AND_ALIAS - combines NAME and ALIAS on one line. If the character has no alias, it will just show his name by itself.%RFULLNAME - obtained from the FULLNAME attribute%RSEX%RAGE - obtained from the AGE attribute %RPOSITION - obtained from the POSITION attribute. Meant to be an IC position (such as a job title or rank) but you could use it for an OOC position (Newbie, Player, Staff, etc.) %RTIMEZONE - obtained from the TIMEZONE attribute. %RALTS - Shows a character's alts.%R[ansi(h,Continued in +shelp +finger_config4)]
&MORE_SHELP_+FINGER_CONFIG4 +finger Functions=[ansi(r,Fields Continued)]%R%RMAIL - shows the number of unread mail messages the player has. Players can choose whether to show this field in +finger or not by setting a SHOWMAIL attribute on themselves to either 1 (to show the # of unread messages) or 0 (to hide it). If the field is hidden, it is not shown at all, not even the "Mail:" prefix.%RSTATUS - shows a character's +set status (IC, OOC, etc) from the STATUS attribute if they're connected, or their last connect time if they're online or set DARK or HIDDEN.%RVACATION - can be used to tell that you're going to be away, and is often integrated with idlenuke systems. Gets its data from the VACATION attribute. If the vacation attribute is empty, nothing is shown at all.%RLOCATION - shows the name of the room the character is currently in. If they have set the unfindable flag on themselves, it will display "UNFINDABLE" for their location.%R[ansi(h,Continued in +shelp +finger_config5)]
&MORE_SHELP_+FINGER_CONFIG5 +finger Functions=[ansi(r,Fields Continued)]%R%RThe following fields are used for spacing:%R%RBLANK - this is used when you want to put extra blank lines between two other fields.%RSECTIONLINE - this can be used if you want to make a clear division between the top and middle, or middle and bottom sections. Just add it at the end of the "top fields" or the beginning of the "bottom fields". You can also use it to divide your top or bottom fields from one another. Don't use it to divide left or right fields.%RSHORTLINE - like sectionline, only it works for dividing fields in the left or right sections. %R%RThe following fields are meant to be displayed in the bottom section only. If you want to display them in the left, right, or top, you will need to modify them.%R%RNOTES - this displays the character's misc. notes, from their NOTES attribute.%RQUOTE - many players like to display a pithy quote for their character. Data is obtained from the QUOTE attribute.%RCONCEPT - meant to be a short description of the character's concept, from their CONCEPT attribute.%RBACKGROUND - some MUSHes like players to display their backgrounds, or at least a trimmed-down public version. This field gets its data from a PUBLIC_BG attribute.%R[ansi(h,Continued in +shelp +finger_config6)]
&MORE_SHELP_+FINGER_CONFIG6 +finger Functions=[ansi(r,Custom Fields)]%R%RYou can add new fields, or edit existing ones, any time you want. Each field has an attribute (with the same name as the field) on the finger database object #FINGER_DB. This attribute gets the data for a player and formats it for display. All field functions use \%0 for the player's DB#.%R%RFor example, maybe you don't want the NAME field to display "Name:" before the character's name. You could edit #FINGER_DB/NAME and remove that text from the field function. Take another example - there is no Rank field currently. If you wanted one, and a character's rank was stored in their RANK attribute, you would type: &rank #FINGER_DB=Rank: \[xget(\%0,rank)\] (you can add whatever formatting to the function you desire (ansi colors, blank spaces, whatever).%R%RYou can even make combo-fields like NAME_AND_ALIAS which display two things on the same line. It's all up to you.%R%RThe only caveat is with linebreaks. You can configure the system to NOT automatically insert line breaks between top and bottom fields (see +shelp +finger_config2) but if you do this, be sure to include the \%R's at the [ansi(h,beginning)] of ALL field descriptions that appear in that section. examine #FINGER_DB/concept to see an example of this for a bottom field.
&HELP_+FINGER +finger Functions=The +finger command allows you to get information about a character.%R%R[ansi(h,+finger <player name or alias>)]%R[ansi(h,+finger/brief <name>)].%R%RThe brief version shows only the information at the top of +finger, not any of the bottom fields.%R%RSee the [ansi(hg,+finger_fields)] help file for instructions on configuring your +finger fields.
&MORE_HELP_+FINGER_FIELDS +finger Functions=Some information in +finger is automatically set, but others you can configure. Below are instructions for setting the +finger fields.%R%RNAME - already set when you created your character%RALIAS - @alias me=<your alias>%RFULLNAME - &fullname me=<your full name>%RSEX - @sex me=<male or female>%RAGE - &age me=<your age>%RTIMEZONE - &timezone me=<your timezone>%RMAIL - &showmail me=<1 to show unread mail, 0 not to show it>%RSTATUS - use the +set command%RVACATION - &vacation me=<when you'll be back>%RNOTES - &notes me=<notes that don't fit in other fields>%RQUOTE - &quote me=<quote>%RCONCEPT - &concept me=<1-line desc of your character>%RBACKGROUND - &public_bg me=<info about your char's background others would know>%R%R%RAFINGER - &afinger me=<1 to get notified if someone fingers you, 0 to not>%R[space(10)]Note: This field doesn't actually show up in +finger
&SHELP_+FINGER +finger Functions=You can set up a lot of things in the +finger system. See the [ansi(h,+shelp +finger_config)] info for details.%R%RYou also probably want to edit the +FINGER_FIELDS help file based on the fields you select, so your players know what they can set.
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ ***** DATA SECTION *****
@@ ***** CHECK BEFORE UPGRADING *****
@@ ***** REMOVE OF MODIFY AS NEEDED *****
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
&BOTTOM_FIELDS +finger Database=CONCEPT BACKGROUND NOTES QUOTE
&LEFT_FIELDS +finger Database=NAME_AND_ALIAS FULLNAME BLANK SEX AGE BLANK POSITION
&RIGHT_FIELDS +finger Database=STATUS LOCATION BLANK ALTS MAIL BLANK TIMEZONE VACATION
&TOP_FIELDS +finger Database=
&BREAK_BOTTOM_FIELDS +finger Database=0
&BREAK_TOP_FIELDS +finger Database=1
&CENTER_DIVIDER +finger Database=[ansi(rand_color(),%B-%B)]
&LEFT_DIVIDER +finger Database=[ansi(rand_color(),==-%B)]
&RIGHT_DIVIDER +finger Database=[ansi(rand_color(),%B-==)]
&LEFT_ALIGN +finger Database=CENTER
&RIGHT_ALIGN +finger Database=CENTER
&BLANK +finger Database=
&SECTIONLINE +finger Database=%R[ansi(rand_color(),repeat(-,78))]
&SHORTLINE +finger Database=[ansi(rand_color(),---------------------------------------)]
&AGE +finger Database=Age: [age(%0)]
&ALIAS +finger Database=switch(hasattr(%0,alias),1,Alias: [xget(%0,alias)])
&PUBLICALTS +finger Database=switch(hasattr(%0,publicalts),1,Alts: [xget(%0,publicalts)])
&ALTS +finger Database=Alts: [alts(%0)]
&BACKGROUND +finger Database=[switch(hasattr(%0,public_bg),1,[u(#FINGER_DB/sectionline)]%R[center(Background,78)]%R[switch(v(enable_eval),1,u(%0/public_bg),xget(%0,public_bg))])]
&CONCEPT +finger Database=[switch(hasattr(%0,concept),1,[u(#FINGER_DB/sectionline)]%R[center(Concept,78)]%R[switch(v(enable_eval),1,u(%0/concept),xget(%0,concept))])]
&COOKIES +finger Database=[switch(cookie_award(%0),,,[cookie_award(%0)] Cookie Award)]
&ENABLE_EVAL +finger Database=1
&FACTION +finger Database=Faction: [xget(%0,faction)]
&FULLNAME +finger Database=xget(%0,fullname)
&LOCATION +finger Database=Location: [switch(hasflag(%0,unfindable),1,UNFINDABLE,[name(loc(%0))])]
&MAIL +finger Database=switch(xget(%0,showmail),1, Mail: [unread_mail(%0)] Unread)
&NAME +finger Database=name(%0)
&NAME_AND_ALIAS +finger Database=[name(%0)] [switch(hasattr(%0,alias),1,\([xget(%0,alias)]\))]
&NOTES +finger Database=[switch(hasattr(%0,notes),1,[u(#FINGER_DB/sectionline)]%R[center(Notes,78)]%R[switch(v(enable_eval),1,u(%0/notes),xget(%0,notes))])]
&POSITION +finger Database=Position: [xget(%0,position)]
&QUOTE +finger Database=[switch(hasattr(%0,quote),1,[u(#FINGER_DB/sectionline)]%R[center(Quote,78)]%R[switch(v(enable_eval),1,u(%0/quote),xget(%0,quote))])]
&RACE +finger Database=Race: [xget(%0,race)]
&SEX +finger Database=Sex: [xget(%0,sex)]
&STATUS +finger Database=switch(1,not(hasflag(%0,connected)),Last On: [xget(%0,last)],hasflag(%0,dark),Last On: [xget(%0,last)],CONNECTED and set [switch(isstaff(%0),1,STAFF,xget(%0,status))])
&TIMEZONE +finger Database=Timezone: [xget(%0,timezone)]
&VACATION +finger Database=xget(%0,vacation)
@wait 7=+jobs/create CODE=+finger/Set up +finger fields. See +shelp +finger_config
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ ***** END DATA SECTION *****
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@pemit/silent %#=[ansi(hg,Setting up database numbers...)]%R
@wait 2=+install/updategroup FINGER
@wait 5=@pemit/silent %#=%R%R[ansi(hg,Installation Complete!!)]
@wait 5=@set me=!quiet