Hangover's Bulletin Board

A bulletin board object with a few simple reading, posting, and deletion commands.

Author: Hangover
Category: Bulletin Board
Compatibility: CobraMUSH, PennMUSH, TinyBit, TinyMUSH, TinyMUX.

Instructions

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

MUSHCode for Hangover's Bulletin Board

@create Board=10
&POST_NOTE Board=$bnote *=*:@switch strlen(%0)=<50,{&HEADER[v(num_notes)] me=%0<[name(*%N)] [extract(time(),1,3)]>;&NOTE[v(num_notes)] me=%1;&PUTBY[v(num_notes)] me=%#;&LIST_NOTES me=[v(list_notes)] [v(num_notes)];&NUM_NOTES me=add(1,v(num_notes));@pemit %#=You have just lodged a note on the Bulletin Board.;@oemit %#=%n posts a note on the board entitled `[%0]'},{@pemit %#=The header for this note is too long!}
&READ_HEADERS Board=$bscan:@pemit %#==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r[center(v(title),80)]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r[switch(v(num_notes),1,%r[center(There are no notes on the board.,80)],[iter(v(list_notes),%r%b%b[##]:%t[v(header[##])])])]%r%r=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;@oemit %#=%n studies the Bulletin Board.
&READ_NOTE Board=$bscan *:@switch member(v(list_notes),%0)=>0,{@pemit %#==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r[center(v(title),80)]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r%rNote: [%0]%rHeader: [v(header[%0])]%r%r[s(v(note[%0]))]%r%r=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-},@pemit %#=There is no note of that number.;@oemit %#=%n read a note entitled `[v(header[%0])]'
&RESET_BOARD Board=$breset:@switch owner(me)=%#,{@dolist v(list_notes)={&NOTE[##] me;&HEADER[##] me};&NUM_NOTES me=1;&LIST_NOTES me;@pemit %#=The Bulletin Board has been reset.},@pemit %#=Sorry but you are not allowed to do that.
&REMOVE_NOTE Board=$bremove *:@switch member(v(admin),%#)=>0,{@switch member(v(list_notes),%0)=>0,{&HEADER[%0] me;&NOTE[%0] me;&LIST_NOTES me=s(edit(v(list_notes),%0,));@switch v(list_notes)=,&NUM_NOTES bbb=1;@pemit %#=You have removed note %0.},@pemit %#=Sorry but there is no note of that number.},@pemit %#=Sorry but you are not allowed to do that.
&ADD_ADMIN Board=$badd *:@switch owner(me)=%#,{@switch type(*%0)=PLAYER,{@switch member(v(admin),num(*%0))=>0,{@pemit %#=Sorry that player is already an Admin member of this board.},{&ADMIN me=v(admin) [num(*%0)];@pemit %#=name(num(*%0)) has now got Admin access to this board.;@pemit num(*%0)=You have been give Admin Access to the Bulletin Board.}},@pemit %#=Sorry there is no player of that name.},@pemit %#=Sorry but only the owner can use this command.
&REMOVE_ADMIN Board=$bsub *:@switch owner(me)=%#,{@switch member(v(admin),num(*%0))=>0,{@switch num(*%0)=%#,{@pemit %#=Sorry but you cannot remove yourself from the Admin list.},{&ADMIN me=s(edit(v(admin),num(*%0),));@pemit %#=name(num(*%0)) has been removed from the Admin list.;@pemit num(*%0)=Your access to the board has been removed.}},@pemit %#=There is no Admin member of that name on this board.},@pemit %#=Sorry but only the owner can use this command.
&BOARD_INFO Board=$binfo:@pemit %#==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r[center(v(title),80)]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r%rThis Bulletin Board was coded by Hangover.%rIf you would like one to use in one of your rooms then mail Hangover.%r%rThe owner of this board is [name(owner(me))].%rThe players having Admin access to the board are: [iter(v(admin),name(##))]%r%r=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
&SET_TITLE Board=$btitle *:@switch owner(me)=%#,{@switch strlen(%0)=>70,@pemit %#=Sorry that title is too long.,{&TITLE me=%0;@pemit %#=Title changed.}},@pemit %#=Sorry but only the owner can use this command.
&ADMIN_COMM Board=$badmin:@switch member(v(admin),%#)=>0,{@pemit %#==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r[center(v(title),80)]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r%rAdmin members also get the use of one more command:%r%r%tbremove #%t%t- remove note number # from the board%r%rThe owner of the board also has extra commands:%r%r%tbadd <name>%t%t- add <name> to the Admin list%r%tbsub <name>%t%t- remove <name> from the Admin list%r%tbreset%t%t%t- reset the Bulletin Board%r%tbtitle <title>%t%t- set the title of the board to <title>%r%r=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-},@pemit %#=Sorry but only Admin members can view these commands.
&NUM_NOTES Board=1
&TITLE Board=Basic Bulletin Board
&ADMIN_TEXT Board==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r[center(v(title),80)]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r%rAdmin members also get the use of one more command:%r%r%tbremove #%t%t- remove note number # from the board%r%rThe owner of the board also has extra commands:%r%r%tbadd <name>%t%t- add <name> to the Admin list%r%tbsub <name>%t%t- remove <name> from the Admin list%r%tbreset%t%t%t- reset the Bulletin Board%r%tbtitle <title>%t%t- set the title of the board to <title>%r%r=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
&WIPE_NOTE Board=$bwipe *:@switch member(v(list_notes),%0)=>0,{@switch v(putby[%0])=%#,{&HEADER[%0] me;&NOTE[%0] me;&PUTBY[%0] me;&LIST_NOTES me=s(edit(v(list_notes),%0,));@switch v(list_notes)=,&NUM_NOTES me=1;@pemit %#=You have removed note %0.},@pemit %#=You did not put that note on the board.},@pemit %#=Sorry but there is no note of that number.
&BOARD_HELP Board=$bhelp:@pemit %#==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r[center(v(title),80)]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-%r%rThis Bulletin Board has the following commands:%r%r%tbnote <header>=<message>%b- puts <message> on the board with a%r%t%t%t%t%b%b%btitle of <header>%r%tbscan%t%t%t%b- lists the headers of all the notes%r%tbscan #%t%t%t%b- shows message number #%r%tbinfo%t%t%t%b- gives some information about the board%r%tbwipe #%t%t%t%b- removes note # from board if you posted it%r%rAdmin members of this board should type `badmin' to get a list of further%rcommands%r%r=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
&ADMIN Board=#6