@@ ======================================================================== @@ .:....1....:....2....:....3....:....4....:....5....:....6....:....7....: @@ ======================================================================== @@ DISCLAIMER: Use at your own risk. @@ This script is intended for the Pennmush server. @@ Guaranteed to break if used in Rhost or MUX. @@ See license at: http://community.pennmush.org/node/343 @@ ======================================================================== @@ .:....1....:....2....:....3....:....4....:....5....:....6....:....7....: @@ ------------------------------------------------------------------------ @@ Announcement @@ th ~> Script started. @@ @@ ======================================================================== @@ .:....1....:....2....:....3....:....4....:....5....:....6....:....7....: @@ ------------------------------------------------------------------------ @@ UPDATE: To update an existing installation, set the following line to @@ your let() function's #dbref. Otherwise, let it set a blank attribute to @@ begin a fresh installation (i.e., leave it alone). @@ &~ me= @@ @@ Setting the above line is all you need to do. Make sure you did it @@ and that you did it the way you wanted. No further changes needed. @@ @@ ------------------------------------------------------------------------ @@ .:....1....:....2....:....3....:....4....:....5....:....6....:....7....: @@ ------------------------------------------------------------------------ @@ Update/Creation Announcement and Implementation... @@ th ~> [ifelse(isdbref(v(~)),Updating,Installing[attrib_set(me/~,create(~let function))][attrib_set(v(~)/DATA,v(~))])]: [name(v(~))]... @@ @@ @@ ------------------------------------------------------------------------ @@ .:....1....:....2....:....3....:....4....:....5....:....6....:....7....: @@ ------------------------------------------------------------------------ @@ Library @@ th ~> [ifelse(dec(words(lparent(v(~)))),Checking,Creating [name(parent(v(~),setr(0,create(Font Library 1))))][attrib_set(%q0/describe,name(%q0))])] @@ @@ @@ ------------------------------------------------------------------------ @@ .:....1....:....2....:....3....:....4....:....5....:....6....:....7....: @@ ------------------------------------------------------------------------ @@ Preparation @@ @@ ======================================================================== @@ .:....1....:....2....:....3....:....4....:....5....:....6....:....7....: @@ ------------------------------------------------------------------------ @@ Credits. @@ &CRED`COPYRIGHT [v(~)]=© Copyright 2007, Chuc McGuire &CRED`LICENSE [v(~)]=WARPEDcore Softcode and Documentation License, http://community.pennmush.org/node/343 @@ @set [v(~)]=DATA`ANSIORDS:[iter(h H u U i I x X r R g G y Y b B m M c C w W,ord(%i0))] @@ @@ Tweak ~let() with no args so that it lists installed fonts after the #dbref. @@ @@ ~let() @@ ~let(]>,) @@ &UFUN`~LET [v(~)]=localize(ifelse(nor(words(%0),words(%1)),%! [iter(lattrp(me/FONT`),after(%i0,`))],switch(1,t(words(setr(e,u(UFUN`ERCK`FONT,setr(f,first(%0,:)))))),%qe,t(words(setr(e,u(UFUN`ERCK`STRING,setr(s,%1))))),%qe,setq(a,u(UFUN`ESET`ANSI,rest(%0,:)))[u(UFUN`DISP,%qf,%qa,%qs)]))) @@ &UFUN`DISP [v(~)]=map(UFUN`DISP2,lnum(1,words(v(FONT`%qf`032),|)),%b,%r) &UFUN`DISP2 [v(~)]=setq(0,%0)[foreach(UFUN`DISP3,%qs)] &UFUN`DISP3 [v(~)]=map(UFUN`DISP4,elements(v(FONT`%qf`[rjust(ord(%0),3,0)]),%q0,|),%b,) &UFUN`DISP4 [v(~)]=ifelse(setr(x,%qa[first(%0,\,)])[setq(y,rest(%0,\,))],ansi(%qx,chr(%qy)),chr(%qy)) @@ @@ @@ &~letlen() @@ &UFUN`~LETLEN [v(~)]=localize(switch(1,t(words(setr(e,u(UFUN`ERCK`FONT,setr(f,first(%0,:)))))),%qe,t(words(setr(e,u(UFUN`ERCK`STRING,setr(s,%1))))),%qe,lmath(add,foreach(#lambda/words(first(v(FONT`%qf`\[rjust(ord(\%0),3,0)\]),|))\%b,%qs)))) @@ &UFUN`ERCK`FONT [v(~)]=ifelse(hasattrp(me,FONT`%qf),,u(UFUN`EMSG-1,%qf)) @@ &UFUN`ERCK`STRING [v(~)]=localize(foreach(#lambda/\[ifelse(hasattrp(me,FONT`%qf`\[rjust(ord(\%0),3,0)\]),,setq(e,\%qe \%0))\],%0)[if(words(%qe),u(UFUN`EMSG-2,%qf,%qe)) @@ &UFUN`ESET`ANSI [v(~)]=foreach(#lambda/if(member(v(DATA`ANSIORDS),ord(\%0)),\%0),%0) @@ &UFUN`EMSG-1 [v(~)]=#-1 No such font: %0 @@ &UFUN`EMSG-2 [v(~)]=#-2 Unsupported character(s) in font %0: %1 @@ @@ ======================================================================== @@ .:....1....:....2....:....3....:....4....:....5....:....6....:....7....: @@ ------------------------------------------------------------------------ @@ &HELP`~LET [v(~)]=%r~let()%r~let(\]>,)%r%rwith no arguments returns the #dbref of the ~let function object, followed by a list of all installed fonts.%r%rif (optional :) and are provided, it returns one of the following...%r%r#-1 if does not exist.%r#-2 if there are characters in which aren't supported in %ror, in with optional applied.%r%rFor example, see: +help ~let2 @@ &HELP`~let2 [v(~)]=%rExample: think ~let(isometricsm:bh,M U S H)%r[~let(isometricsm:bh,M U S H)]%r%rFonts installed on [mudname()]: [rest(~let())] @@ &HELP`~letlen [v(~)]=%r~letlen(,)%r%rreturns the actual screen width of displayed in , or the following errors%r%r#-1 if does not exist.%r#-2 if there are characters in which aren't supported in %r @@ @@ ======================================================================== @@ .:....1....:....2....:....3....:....4....:....5....:....6....:....7....: @@ ------------------------------------------------------------------------ @@ @@ From Javelin: add the following to a wiz object's @startup @@ @@ @function ~let=<#dbref>,ufun`~let @@ @function ~letlen=<#dbref>,ufun`~letlen @@