-
Notifications
You must be signed in to change notification settings - Fork 0
/
Finger System.txt
61 lines (43 loc) · 5.5 KB
/
Finger System.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@skip isdbref(tag(setr(1,finger)))={@assert/inline isdbref(globalroom())=@pemit %#=ERROR: No master room set!;@assert/inline isdbref(setr(0,create(Finger System,,t)))=@pemit %#=ERROR: Could not create code object %q1: %q0;@set %q0=INDESTRUCTIBLE !NO_COMMAND;@tag/add %q1=%q0;@tel %q0=globalroom()}
@@ Commands and stuff.
&CMD.FINGER #finger=$^(?s)(?\:@|\+)?(finger)(?\:/(\\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach #inc/GET_SWITCH=%2;@attach %!/SW.[strfirstof(%q<switch>,MAIN)]=%3,%4
@set #finger/CMD.FINGER=regexp
&SWITCHES.0 #finger=SET|CONFIG|SILENT
&SW.CONFIG #finger=@attach #inc/CONFIG=%0,trim(%1),%!
&CONFIG.LEFT.DESC #finger=The Left column. |-separated list of GETTER~Name~Default
&CONFIG.LEFT.DEFAULT #finger=SEX
&CONFIG.LEFT.TYPE #finger=WORD
&CONFIG.RIGHT.DESC #finger=The Right column. |-separated list of GETTER~Name~Default
&CONFIG.RIGHT.DEFAULT #finger=SPECIES~~Unknown
&CONFIG.RIGHT.TYPE #finger=WORD
&CONFIG.VERTICAL.DESC #finger=The Vertical column under Left and Right. |-separted list of GETTER~Name~Default. Blank fields will be skipped.
&CONFIG.VERTICAL.DEFAULT #finger=QUOTE|PROFILE|SKILLS
&CONFIG.VERTICAL.TYPE #finger=WORD
&CONFIG.PLAYERFIELDS.DESC #finger=The fields which players can set.
&CONFIG.PLAYERFIELDS.DEFAULT #finger=SEX|QUOTE|PROFILE|SKILLS|SPECIES
&CONFIG.PLAYERFIELDS.TYPE #finger=WORD
&CONFIG.ADMINFIELDS.DESC #finger=|-separated fields that only staff can set.
&CONFIG.ADMINFIELDS.DEFAULT #finger=
&CONFIG.ADMINFIELDS.TYPE #finger=WORD
&CONFIG.LOCKEDFIELDS.DESC #finger=Fields in PLAYERFIELDS which stop being settable if the player is approved.
&CONFIG.LOCKEDFIELDS.DEFAULT #finger=SEX|QUOTE|PROFILE|SKILLS|SPECIES
&CONFIG.LOCKEDFIELDS.TYPE #finger=WORD
&SW.MAIN #finger=@attach #inc/GET_PLAYER=strfirstof(%0,%#),target;@attach %!/RENDER_FINGER=%q<target>;@skip %2={@trigger %q<target>/AFINGER=%:}
&SW.SILENT #finger=@attach %!/SW.MAIN=%0,%1,1
&RENDER_FINGER #finger=th setq(!,ansi(confoverride(%#,BORDER),if(confoverride(%1,SCREENREADER),%b,|)),bord);@pemit %#=header(cname(%0),,,1);th setq(!,getconf(%!,LEFT),col1);th setq(!,getconf(%!,RIGHT),col2);th iter(1 2,setq(!,lmax(iter(r(col%i0),strlen(elementsmux(%i0,2,~)),|,%b)),rjust%i0));th setq(!,floor(fdiv(sub(width(%#),7),2)),col1width);th setq(!,ceil(fdiv(sub(width(%#),7),2)),col2width);th iter(1 2,setq(!,trim(iter(r(col%i0),ansi(%q<co>,rjust(strfirstof(elementsmux(%i0,2,~),capnames(elementsmux(%i0,1,~))),r(rjust%i1))):%B[strfirstof(u(%!/GETTER.[elementsmux(%i0,1,~)],%0,%:),elementsmux(%i0,3,~))],|,%R),r,%R),col%i0data));@pemit %#=printf($1.&:%q<bord>:s $%q<col1width>|-"s $1.&:%q<bord>:s $%q<col2width>|-"s $1.&:%q<bord>:s,%R,%q<col1data>,%R,%q<col2data>,%R);th setq(!,sub(width(%#),4),cenwidth);@dolist/inline/delimit | [getconf(%!,VERTICAL)]={@if strlen(setr(!,strfirstof(u(GETTER.[elementsmux(%d0,1,~)],%0,%:),elementsmux(%d0,3,~)),txt))={@pemit %#=subheader(strfirstof(elementsmux(%d0,2,~),capnames(elementsmux(%d0,1,~))),,,1);@pemit %#=printf($1.&:%q<bord>:s $%q<cenwidth>|-"s $1.&:%q<bord>:s,%R,%q<txt>,%R)}};@pemit %#=footer(,,,1)
&SW.SET #finger=@if strmatch(%0,*/*)={@assert/inline gtebittype(%#,5)=@pemit %#=Permission denied.;th setq(!,before(%0,/),player);th setq(!,after(%0,/),field);@attach #inc/GET_PLAYER=%q<player>,target},{th setq(!,%:,target);th setq(!,%0,field)};@assert/inline words(setr(!,setdiff(setunion(getconf(%!,PLAYERFIELDS),if(gtebittype(%#,5),getconf(%!,ADMINFIELDS)),|,|),if(cand(not(gtebittype(%#,5)),isapproved(%#)),getconf(%!,LOCKEDFIELDS)),|,|),fields),|)=@pemit %#=No finger fields that can be set by you!;@attach #inc/PARTIAL=%q<field>,%q<fields>,|,field,finger field;@attach %!/SETTER.%q<field>=%q<target>,%1;@if strmatch(%q<target>,%:)={@pemit %#=Set.},{@pemit %#=You set [cname(%q<target>)]'s Finger Field '%q<field>' to: %1;@pemit %q<target>=Your Finger Field '%q<field>' has been set to: %1}
&GETTER.SEX #finger=get(%0/SEX)
&GETTER.SPECIES #finger=get(%0/FINGER.SPECIES)
&GETTER.QUOTE #finger=get(%0/FINGER.QUOTE)
&GETTER.PROFILE #finger=get(%0/FINGER.PROFILE)
&GETTER.SKILLS #finger=get(%0/FINGER.SKILLS)
&SETTER.SEX #finger=@sex %0=%1
&SETTER.SPECIES #finger=@set %0=FINGER.SPECIES:%1
&SETTER.QUOTE #finger=@set %0=FINGER.QUOTE:%1
&SETTER.PROFILE #finger=@set %0=FINGER.PROFILE:%1
&SETTER.SKILLS #finger=@set %0=FINGER.SKILLS:%1
&HLP.SETTABLE #finger=%R%R[ansi(hw,Fields settable by players:)]%R[edit(getconf(%!,PLAYERFIELDS),|,\,%B)][if(globalconf(REQAPPROVAL),%R%R[ansi(hw,Fields locked after approval:)]%R[edit(getconf(%!,LOCKEDFIELDS),|,\\,%B)])]%R%R[ansi(hw,Fields only Staff may set:)]%R[edit(getconf(%!,ADMINFIELDS),|,\,%B)]
+help/add Character/+finger=#finger/HLP.FINGER
&HLP.FINGER #finger=[ansi(hw,@finger \[<player>\])]%R%TDisplays overview of character information about <player>. Defaults to self if <player> is blank.%R%R[ansi(hw,@finger/set <field>=<value>)]%R%TSets a field.[u(HLP.SETTABLE)]%R%R[ansi(hc,Afinger)]%R%TBeing a target of +finger triggers the AFINGER attribute. You can use this to be alerted when others +finger you. Example:%R&afinger me=think \[cname(%%0)\] has +finger'd you.%R%RTo +finger without triggering AFINGER, use [ansi(hw,+finger/silent)]
+shelp/add Character/+finger=#finger/SHLP.FINGER
&SHLP.FINGER #finger=[ansi(hc,Admin Commands)]%R%R[ansi(hw,@finger/config \[<option>=<value>\])]%R%TView/set config options. Much of @finger can be configured.%R%R[ansi(hw,@finger <player>/<field>=<value>)]%R%TSet a specific player's fields.[u(HLP.SETTABLE)]%R%R[ansi(hc,Modifying Finger)]%R%RNew fields are easy to add to @finger by adding GETTER and SETTER attributes to the #finger object. Sex and species are included as examples.