David Functions

A small set of functions for use with PennMUSH.

Author: Unknown
Category: Functions
Commands: @create, @describe, @set.
Compatibility: CobraMUSH, PennMUSH, TinyBit.

Instructions

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

MUSHCode for David Functions

@create David's Functions
@lock/Basic David's Functions==me
@set David's Functions = NO_COMMAND
@set David's Functions = VISUAL
@DESCRIBE David's Functions=Examine for a list of functions.
@set David's Functions/DESCRIBE=no_command visual
&FUN_FINDABLE David's Functions=switchall(t(inc(conn(%0)))[hasflag(%0,UNFIND)][t(loc(%0))],0??,C,?1?,P,??0,R)
&FUN_FINDABLE_HELP David's Functions=This function tells you whether you can find someone, and if not, why. C:Not connected. P:player=UNFINDABLE, O:room=UNFINDABLE
&FUN_FINDABLE_MESSAGE David's Functions=switch(u(FUN_FINDABLE,%0),*C*,That player is not connected,*P*, That player is set unfindable.,*R*,That player is in an unfindable room.)
&FUN_HELP_PARSE David's Functions=switch(first(lattr(#2339/MSG_%0)),,No such topic.,u(MENU_PARSE,xget(#2339,#$)))
&LISTFORMAT David's Functions=itemize(%0,%2,%1)[pemit(#1907,FIX %#)]
&MENU_BOTTOM David's Functions=`[repeat(-,72)]'
&MENU_LINE David's Functions=| %0[repeat(%b,sub(70,strlen(%0)))] |
&MENU_LINE_WRAP David's Functions=map(menu_line,wrap(%0,70,70,~),~)
&MENU_PARSE David's Functions=u(MENU_TOP,first(%0,=))%r[edit(map(MENU_LINE_WRAP,rest(edit(%0,~~,~ ~),=),~),~,%r)]%r[u(MENU_BOTTOM)]
&MENU_TOP David's Functions=%b %b[repeat(_,add(2,strlen(%0)))]%r._/ %0 \\[repeat(_,sub(67,strlen(%0)))].
&SPEECH David's Functions=%n[switch(left(%0,1),:,%b[delete(%0,0,1)],;,[delete(%0,0,1)],%bsays\, "%0")]
&YESNO David's Functions=switch(%0,on,1,off,0,y*,1,n*,0,e*,1,d*,0,0)