Function Of The Day

Allows you to display a "Function of the Day" to players who connect, as well as when the '+fotd' global is typed.

Author: Sketch@M*U*S*H
Category: Globals
Compatibility: PennMUSH.

Instructions

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

MUSHCode for Function Of The Day

@create FoTD
@link FoTD = #0
@set FoTD = !NO_COMMAND
@power FoTD = Cemit
@power FoTD = Pemit_All
@power FoTD = See_All
@power FoTD = Can_spoof
@ACONNECT FoTD=@break member(cwho(Softcode),%#)={@wait 3={@nspemit %#=u(message)}}
@set FoTD/ACONNECT=no_command prefixmatch
&CMD_FOTD FoTD=$+fotd:@nspemit %#=u(message)
&CREDITS FoTD=This was Nammyung's idea. Coded by Sketch. Mon Jun 18 21:45:43 2007
@set FoTD/CREDITS=no_command
&CREDITS_02 FoTD=Thursday, d-m-y 29-9-2007, Paige/d'Ark suggested that @message be used instead of @nscemit. Done.
&CREDITS_03 FoTD=Tuesday, y-m-d 2010-2-16, made &trg_next_function automatically roll over.
&CRON_DAILY FoTD=@trigger me/trg_next_function
@set FoTD/CRON_DAILY=no_command prefixmatch
&FUNCTIONS_DIFF FoTD=GRABALL POLL XOR MAILFROM BNOT NCON LREPLACE ROOM LSET POWER WRAP ATAN2 MEDIAN NVEXITS LDELETE VDIM XVPLAYERS FOLDERSTATS SETQ FIRST E LTHINGS LSEARCH ELEMENT LPARENT PCREATE NCONDALL LINK MTIME MEMBER GET SPACE LWHO ZWHO LLOCKS BENCHMARK LAST SLEV BRACKETS MWHOID REMIT BOR LJUST MAILFSTATS IPADDR LPOS XMWHO CONVTIME PFUN NEQ MAIL STRALLOF POWERS CBUFFERADD NVPLAYERS LVEXITS NEXT REGXATTRP STRMATCH NULL OBJMEM SUBJ LPLAYERS MAILSEND FULLNAME SORT SHL ATTRIB_SET UNSETQ SPEAK ESCAPE GT REVWORDS CHILDREN UCSTR LINSERT RECV MUDNAME APOSS GREPI ZONE FLAGS REGNATTRP CONFIG MEAN BNAND VISIBLE XTHINGS ART CEIL SETUNION SQRT @@ COS MALIAS POS EMIT TESTLOCK ISOBJID CSTATUS UFUN EVAL CUSERS ADD FINDABLE WORDS REGRABALLI SQUISH NEXTDBREF ISINT DIGEST SPLICE CTITLE FN ATRLOCK LIST STRIPACCENTS SPELLNUM LMATH HASATTR ASIN T REMAINDER OBJID NPLAYERS ENTRANCES REGMATCHI REMOVE CMDS SQLESCAPE ISWORD AFTER IFELSE LEFT STRINSERT XEXITS REGMATCH TABLE OBJEVAL DIV NSPEMIT FLIP NEARBY VADD PROMPT BEEP RLOC CONDALL DECRYPT GTE REGRAB WIDTH STDDEV SETR INUM LOCKS PUEBLO HASFLAG XVCON TRUNC ELIST LSEARCHR SIN LVTHINGS TRIMTINY FUNCTIONS EQ ACCNAME ULAMBDA NUM NCOR VERSION LOCKOWNER TR ORLPOWERS RESWITCHALLI HASATTRVAL ROUND CLFLAGS ORDINAL NAND RAND NSZEMIT SWITCHALL FULLALIAS SOUNDEX XATTRP SSL REGLATTRP FRACTION NCAND HASATTRPVAL LETQ ENCRYPT OBJ TEXTFILE PORTS NSEMIT XVEXITS NTHINGS CTU LEMIT NOR CDESC SORTKEY LOG REGXATTR CONVUTCTIME ROOT RESWITCHALL ISREGEXP CWHO RESTARTTIME LIT NSEARCH MAX ETIMEFMT MAILSUBJECT EDIT MAILSTATUS ELEMENTS COLORS MATCH MAILTIME HOME LISTQ VUNIT COND ANDFLAGS DIST3D TIMEFMT XCON TIMESTRING SCAN FLOOR VMUL SET BEFORE LPIDS MESSAGE CEMIT LTE NAMELIST LN REGNATTR ITER AND WILDGREPI CAPSTR EDEFAULT BXOR TEXTENTRIES NATTR ZFUN OPEN LOCALIZE PMATCH HASTYPE FILTERBOOL ALPHAMIN V MAILSTATS LOCKFLAGS RESWITCHI INAME SHA0 IF COMP SECURE COR ACOS NMWHO LATTR NSREMIT VCROSS CLOCK TYPE SENT ABS CAND RESWITCH STARTTIME SECS UTCTIME CAT LT STEXT NAME FOLLOWERS IDLE ITEMIZE ENDTAG NSPROMPT ALPHAMAX HASPOWER PLAYER CONVUTCSECS TAG ELOCK XATTR
&LAST_FUNCTIONS FoTD=ULAMBDA
&MESSAGE FoTD=The function of the day is: [v(today)]()
@set FoTD/MESSAGE=no_command
&ROLLOVER FoTD=300
&TODAY FoTD=GRABALL
@set FoTD/TODAY=no_command
&TRG_ANNOUNCE_DAILY FoTD=@message cwho(softcode,on)=<Softcode> [setr(0,u(message))],chatformat,|,Softcode,%q0,FoTD,,<Softcode> %q0
@set FoTD/TRG_ANNOUNCE_DAILY=no_command
&TRG_NEXT_FUNCTION FoTD=@set me=today:[setr(0,randword(setdiff(functions(builtin),v(functions_diff))))];@set me=functions_diff:[extract(cat(%q0,v(functions_diff)),1,v(rollover))];@trigger me/trg_announce_daily
@set FoTD/TRG_NEXT_FUNCTION=no_command

think Place this object in the Master Room, and make sure TRG_NEXT_FUNCTION is triggered once a day.
+fotd