Instructions

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

MUSHCode for ~finger command

@create ~finger
@set ~finger = !NO_COMMAND
&COMMENTARY ~finger=After you've read the existing commentary`** attribs (all of them, not just this one), use them as your initial migration to a better attribute naming structure for development notes and/or history (I've given this as public domain, and I speculate that this will likely become the primary and/or only documentation which stands a chance of surviving along with the code... so it's probably wise to explore and use its potential as early as possible.) // Artistic Expression. Jav and Raev might remember this from some of my earlier contrib-code. I use it as a matter of stylistic freedom ... to assert my right to do it "this way" even if it's "not the right way" (i.e., to remove inhibition in what I'm willing to try - sometimes I can't immediately "see" the "right way", but can see "a way"... so I don't want to be inhibited from trying it due to uncertainty about whether it's "the right way"). The thing I'm talking about is my triple shuffle code -- first(shuffle(shuffle(shuffle(w i b b l e f o o)))) -- akin to shuffling a new deck of cards three times before dealing. It's just a personal 'artistic mark' of mine that I put in my code with consistency. Feel free to condense/rewrite it, but don't expect me to quit using it when I write code.
&COMMENTARY`0-MIGRATION ~finger=First and foremost, I'd recommend migrating the current +finger features into this object, attempting to retain the best of both worlds along the way. Once you get this object 'up to par' with the global one, you can replace the global one with this one.
&COMMENTARY`BOUNDARIES ~finger=I honestly don't know where the boundary between motif and template actually is... in fact, there may even be another category - blueprint (which, theoretically, would be basically the align() function)... such that the 'template' is the data set (text info) and how it's displayed and the 'blueprint' would become the evolution of/toward whatever you can handle with align().... or some such. At present, I've simply tried to duplicate M*U*S*H's existing staticly formatted +finger display... in a way which allows 'motifs' (without digging too deeply into templates/blueprints)... things that allow players to do some custom code to headers/footers/borders and such.
&COMMENTARY`REGISTERS.COLORS ~finger=document %q-register usage, and use %q-registers purposefully thereto. I'm thinking ... expand on the idea of finger`setup`... and therein, setup your colors... for a motif, if someone is using more than nine colors, they've gone insane so give them %q1-9 (respectively, all in order, all in one attribute). This leaves 0 and a-z for other things. For example, I used %qm for mudname() and %qz for line number info... and, I think %q0 should always be reserved as reusable (can't be claimed by any process or pre-contrived representation)... regardless of whether you're in a ulocal()-ized environment (so local configs will know that they CAN use %q0 safely at any time). Also... consider applying two of the pre-define color %q-registers to the default template colors: foreground and background (or vice versa). (SEE: the percent-q`<tree>)
&COMMENTARY`Z-FINAL ~finger=I wrote this for the purpose of CREATING options. But I also understand the need for reasonable limits (see my comment about number of colors). These comments are all intended at a meta-code level (i.e., they're not intended as specific suggestions, but rather as 'theoretical ideas' used as pointers toward a 'theoretical ideal' ... i.e., they're the way I discuss softcode via illustrative reference). I got it this far... see how much further you can get it.
&FINGER ~finger=
&FINGER`CMND ~finger=$~finger *:@pemit %#=[setq(0,switch(%0,me,%#,pmatch(*%0)))][ifelse(isdbref(%q0),u(finger`ufun,%q0),switch(%q0,#-1,No such player as '%0'.,#-2,I don't know which '%0' you mean.,Unknown Error))]
&FINGER`UFUN ~finger=[u(finger`ufun`[ifelse(v(template),v(template),template)],%0)]
&FINGER`UFUN`TEMPLATE ~finger=[setq(z,0)][u(motif`[setr(m,v(motif))]`setup)][u(motif`%qm`header)]%r[iter(. NAME ALIAS POS LOC RLOC . [if(get(%0/fcs),iter(get(%0/fcs),fc.[ucstr(%i0)],%b,%b.%b)%b.%b)][ifelse(member(lwho(),%0),ONLINE . DOING .,LAST TIME .)][setq(q,14)][setq(r,strlen(u(motif`%qm`bridge)))][setq(s,strlen(first(u(motif`%qm`lborder),%r)))][setq(t,strlen(first(u(motif`%qm`rborder),%r)))][setq(u,sub(76,lmath(add,%qq %qr %qs %qt)))],%b[u(finger`ufun`template.align,%0,%i0,%qs,%qq,%qr,%qu,%qt)][setq(z,add(%qz,max(1,words(%qw,%r))))],%b,%r)]%r[u(motif`%qm`footer)]
&FINGER`UFUN`TEMPLATE.0 ~finger=[repeat(switch(%0,,%b,u(motif`%qm`lfiller)),sub(%1,inc(strlen(%0))))] %0
&FINGER`UFUN`TEMPLATE.0.ALIAS ~finger=KNOWN ALIASES
&FINGER`UFUN`TEMPLATE.0.CHANNELS ~finger=CHANNELS
&FINGER`UFUN`TEMPLATE.0.DOING ~finger=@DOING
&FINGER`UFUN`TEMPLATE.0.LAST ~finger=LAST ON
&FINGER`UFUN`TEMPLATE.0.LOC ~finger=LOCATION
&FINGER`UFUN`TEMPLATE.0.MUDNAME ~finger=
&FINGER`UFUN`TEMPLATE.0.NAME ~finger=[switch(poss(%0),his,MALE,her,FEMALE,its,NEUTER,their,PLURAL)]
&FINGER`UFUN`TEMPLATE.0.ONLINE ~finger=CONNECTED
&FINGER`UFUN`TEMPLATE.0.POS ~finger=POSITION
&FINGER`UFUN`TEMPLATE.0.RLOC ~finger=REAL LOCATION
&FINGER`UFUN`TEMPLATE.0.TIME ~finger=TIME NOW
&FINGER`UFUN`TEMPLATE.1 ~finger=[setr(w,wrap(%0,%1,%1,%r))]
&FINGER`UFUN`TEMPLATE.1.ALIAS ~finger=edit(get(%0/alias),;,;%b)
&FINGER`UFUN`TEMPLATE.1.CHANNELS ~finger=edit(channels(%0,|),|,\,%b)
&FINGER`UFUN`TEMPLATE.1.DOING ~finger=ansi(h,doing(%0))
&FINGER`UFUN`TEMPLATE.1.LAST ~finger=ansi(r,get(%0/last))
&FINGER`UFUN`TEMPLATE.1.LOC ~finger=ifelse(isdbref(setr(l,loc(%0))),[name(%ql)] %ql\([flags(%ql)]\),ifelse(hasflag(%0,unfindable),PLAYER,ROOM) UNFINDABLE)
&FINGER`UFUN`TEMPLATE.1.MUDNAME ~finger=[mudname()]
&FINGER`UFUN`TEMPLATE.1.NAME ~finger=name(%0) %0\([flags(%0)]\)
&FINGER`UFUN`TEMPLATE.1.ONLINE ~finger=[ljust(ansi(b,timestring(conn(%0))),18)] IDLE[u(finger`ufun`bridge.[u(motif)])] [ansi(ifelse(lt(idle(%0),3600),g,r),timestring(idle(%0)))]
&FINGER`UFUN`TEMPLATE.1.POS ~finger=get(%0/position)
&FINGER`UFUN`TEMPLATE.1.RLOC ~finger=get(%0/location)
&FINGER`UFUN`TEMPLATE.1.TIME ~finger=ansi(b,time())
&FINGER`UFUN`TEMPLATE.ALIGN ~finger=align(%2. >%3 %4 %5 %6.,u(motif`%qm`lborder),u(finger`ufun`template.0,switch(%1,fc.*,edit(rest(%1,.),_,%b),u(finger`ufun`template.0.%1,%0)),%3),switch(%1,.,space(strlen(u(motif`%qm`bridge))),u(motif`%qm`bridge)),u(finger`ufun`template.1,switch(%1,fc.*,s(get(%0/%1)),u(finger`ufun`template.1.%1,%0)),%5),u(motif`%qm`rborder),,,%r%b)
&FINGER`UTILITY ~finger=
&FINGER`UTILITY`STRLEN ~finger=strlen(u(finger`ufun`template.0.%0))
&MOTIF ~finger=mush
&MOTIF`FLORAL ~finger=
&MOTIF`FLORAL`BRIDGE ~finger=%b[ansi(%q3,chr(171))][ansi(%q2,\{)][ansi(%q1,%qf)][ansi(%q2,\})][ansi(%q3,[chr(187)])]%b
&MOTIF`FLORAL`COLORS ~finger=first(shuffle(shuffle(shuffle(r y c b m w))))h [first(shuffle(shuffle(shuffle(g gh wh w x))))] [first(shuffle(shuffle(shuffle(g gh wh w x y))))]
&MOTIF`FLORAL`FLOWER ~finger=first(shuffle(shuffle(shuffle(chr(42) [chr(64)] [chr(169)]))))
&MOTIF`FLORAL`FOOTER ~finger=%b[u(motif`%qm`lborder)][repeat(ansi(%q3,[chr(171)])[ansi(%q2,\{)][ansi(%q1,%qf)][ansi(%q2,\})][ansi(%q3,[chr(187)])],14)][u(motif`%qm`rborder)]%r%b[center(ansi(%q3,[chr(175)][chr(96)][chr(171)])[ansi(%q2,\{)] [center(edit(ansi(bh,elements(elements(time(),4),1 2,:,:)),chr(58),ansi(mh,chr(58))),strlen(mudname()))] [ansi(%q2,\})][ansi(%q3,[chr(187)][chr(180)][chr(175)])],41)]%r%b[center(ansi(%q2,repeat(chr(175),9)),41)]
&MOTIF`FLORAL`HEADER ~finger=%b[center(ansi(%q2,repeat(_,9)),41)]%r%b[center(ansi(%q3,_.[chr(171)])[ansi(%q2,\{)] [edit(ansi(bh,mudname()),chr(42),ansi(mh,chr(42)))] [ansi(%q2,\})][ansi(%q3,[chr(187)]._)],41)]%r%b[u(motif`%qm`lborder)][repeat(ansi(%q3,[chr(171)])[ansi(%q2,\{)][ansi(%q1,%qf)][ansi(%q2,\})][ansi(%q3,[chr(187)])],14)][u(motif`%qm`rborder)]
&MOTIF`FLORAL`LBORDER ~finger=[ansi(%q1,%qf)][ansi(%q2,\})][ansi(%q3,chr(187))]
&MOTIF`FLORAL`RBORDER ~finger=[ansi(%q3,chr(171))][ansi(%q2,\{)][ansi(%q1,%qf)]
&MOTIF`FLORAL`SETUP ~finger=[iter(1 2 3[setq(c,u(motif`floral`colors))][setq(f,u(motif`floral`flower))],setq(%i0,elements(%qc,%i0)),%b,)]
&MOTIF`LCARS ~finger=
&MOTIF`LCARS`BRIDGE ~finger=%b[ansi(%q3,[chr(173)][chr(247)][chr(173)])]%b
&MOTIF`LCARS`COLORS ~finger=bh [first(shuffle(shuffle(shuffle(r y g c b m w))))] [first(shuffle(shuffle(shuffle(r y g c b m w rh yh gh ch bh mh wh))))]
&MOTIF`LCARS`FOOTER ~finger=%b [ansi(%q1,repeat(chr(175),74))]
&MOTIF`LCARS`HEADER ~finger=%b [ansi(%q1,repeat(_,add(7,strlen(setr(n,mudname())))))][rjust(ansi(%q1,_______),sub(67,strlen(%qn)))]%r %b[ansi(%q2,\))] %b [edit(ansi(bh,%qn),chr(42),ansi(mh,chr(42)))] %b [ansi(%q1,\\[repeat(_,sub(58,strlen(%qn)))]/ [edit(ansi(bh,elements(elements(time(),4),1 2,:,:)),:,ansi(mh,:))] \))][setq(z,inc(%qz))]
&MOTIF`LCARS`LBORDER ~finger=[ansi(%q2,ifelse(mod(%qz,2),[ansi(h,\()]%b%r%b\),%b\)%r[ansi(h,\()]%b))]
&MOTIF`LCARS`RBORDER ~finger=[ansi(%q2,if(mod(%qz,2),\(%b%r%b[ansi(h,\))],%b[ansi(h,\))]%r\(%b))]
&MOTIF`LCARS`SETUP ~finger=iter(u(motif`lcars`colors),setq(inum(0),itext(0)),%b,)
&MOTIF`LCARS2 ~finger=
&MOTIF`LCARS2`BRIDGE ~finger=%b[ansi(%q3,[chr(173)][chr(247)][chr(173)])]%b
&MOTIF`LCARS2`COLORS ~finger=b [first(shuffle(shuffle(shuffle(r y g c b m w x))))] [first(shuffle(shuffle(shuffle(r y g c b m w rh yh gh ch bh mh wh x))))]
&MOTIF`LCARS2`FOOTER ~finger=%b [ansi(%q1,repeat(chr(175),74))]
&MOTIF`LCARS2`HEADER ~finger=%b [ansi(%q1,repeat(_,add(4,strlen(setr(n,mudname())))))]%r [u(motif`%qm`lborder)] [edit(ansi(bh,%qn),chr(42),ansi(mh,chr(42)))] [ansi(%q1,\\[repeat(_,sub(65,strlen(%qn)))])][elements(elements(time(),4),1 2,:,:)]
&MOTIF`LCARS2`LBORDER ~finger=[ansi(B%q2h,\(_)][ansi(%q2h,_)]
&MOTIF`LCARS2`LFILLER ~finger=[ansi(%q2,_)]
&MOTIF`LCARS2`RBORDER ~finger=[ansi(B%q2,:[chr(247)][chr(45)])]
&MOTIF`LCARS2`SETUP ~finger=iter(u(motif`lcars2`colors),setq(inum(0),itext(0)),%b,)
&MOTIF`MUSH ~finger=
&MOTIF`MUSH`BRIDGE ~finger=: %b
&MOTIF`MUSH`FOOTER ~finger=%b[center(ansi(b,repeat(chr(175),69)),77)]
&MOTIF`MUSH`HEADER ~finger=%b[center(ansi(b,repeat(_,add(2,strlen(setr(n,%bM * U * S * H%b))))),77)]%r [center(edit(ansi(b,repeat(_,setr(y,div(sub(65,strlen(%qn)),2)))\/ [ansi(bh,%qn)] \\[repeat(_,%qy)]),chr(42),ansi(mh,chr(42))),77)]
&MOTIF`MUSH`LBORDER ~finger=%b
&MOTIF`MUSH`RBORDER ~finger=%b
&PERCENT-Q ~finger=this is a partial list of some proposed %q-register implementations.
&PERCENT-Q`0 ~finger=reserved as reusable (always subject to containing stale info).
&PERCENT-Q`1 ~finger=proposed as for default Background color, (template -finger`setup?- code should set this via setq(1,left(capstr(<foo>),1)) or such).
&PERCENT-Q`2 ~finger=proposed as default foreground - setq(2,left(lcstr(<foo>),1))
&PERCENT-Q`3-9 ~finger=other usable colors (default on these could be randomized or blank/n).
&PERCENT-Q`I ~finger=likely candidate for idle().
&PERCENT-Q`M ~finger=I used this for mudname().
&PERCENT-Q`T ~finger=Although I haven't done this yet, it's a likely candidate for time().
&PERCENT-Q`Z ~finger=I used this as a line counter in the template to support the squiggly l/r-borders in lcars2.
&TEMPLATE ~finger=template
&~ ~finger=

~finger %n