Taisch's Simple Bulletin Board
A simple bulletin board. If you want to make it exclusive, you'll need to @lock/use the thing.
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for Taisch's Simple Bulletin Board
A simple bulletin board. If you want to make it exclusive, you'll need
to @lock/use the thing. If you're looking for a nice global bulletin
board for your MUSH, I recommend Myrddin's softcoded board. (This does
require wiz privileges to set up.)
Simple bulletin board:
As usual, the lines have been split up for editing purposes.
If you want to use this code, you'll have to splice the lines back
together. You might also want to play with the spacing in
the &xheader and &cmd-read attributes if things don't line up
right on each line.
--- Taisch, 16-December-1999
========================================================================
@create board
@set board=command
@lock board=me
@desc board=This is a bulletin board set up on a convenient wall.
@adesc board=@pemit %#=Type '+bhelp' for commands.
&cmd-help board=$+bhelp:@pemit %#=[u(text-help)]
&cmd-scan board=$+bscan:@pemit %#=[repeat(=,79)]%r[space(5)]Title:[space(34)]Author:[space(17)]Date:%r[repeat(-,79)]%r [iter(sort(lattr(me/post-*),n),[u(xformat,get(me/##),##)]%r)][repeat(-,79)]%r +bread <number> to read a note., +bhelp for more info.%r[repeat(=,79)]
&cmd-scanfrom board=$+bscan/from *:@pemit %#=[repeat(=,79)]%r[space(5)]Title:[space(34)]Author:[space(17)]Date:%r[repeat(-,79)]%r [iter(cat(POST-%0,after(sort(lattr(me/post-*),n),POST-%0)),[u(xformat,get(me/##),##)]%r)][repeat(-,79)]%r +bread <number> to read a note., +bhelp for more info.%r[repeat(=,79)]
&cmd-read board=$+bread *:@pemit %#=[switch(hasattr(me,post-%0),0,No such post,[repeat(=,79)]%r[rjust(%0,4)] | [ljust(mid(first(rest(rest(get(me/post-%0),|),|),|),0,39),40)] | [ljust(mid(name(first(get(me/post-%0),|)),0,20),22)] [ljust(mid(first(rest(get(me/post-%0),|),|),0,6),8)]%r[repeat(-,79)]%r[rest(rest(rest(get(me/post-%0),|),|),|)]%r[repeat(=,79)])]
&cmd-post board=$+bpost *=*:th [setq(0,add(1,last(last(sort(lattr(me/post-*),n)),-)))];&post-[max(1,%q0)] me=%#|[rest(time())]|%0|%1;@pemit %#=You post to the board.
&cmd-edit board=$+bedit *=*/*:@switch %#=[first(get(me/post-%0),|)],{[setq(0,edit(rest(rest(rest(get(me/post-%0),|),|),|),%1,%2))];&post-%0 me=[extract(get(me/post-%0),1,3,|)]|%q0;@pemit %#=Post now reads:%r%q0;},{@pemit %#=You may only edit your own posts.}
&cmd-delete board=$+brem *:@switch %#=[first(get(me/post-%0),|)],{&post-%0 me=;@pemit %#=Post deleted.},{@pemit %#=You may only delete your own posts.}
&cmd-badminclear board=$+brem/upto *:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=Wiping...;@switch [hasattr(me,post-%0)]=0,{@pemit %#=No such post!},{@dolist [cat(POST-%0,before(sort(lattr(me/post-*),n),POST-%0))]=&## me=;}}
&cmd-badmin-add board=$+badmin/add *:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=Adding...;&list-admins me=[setunion(get(me/list-admins),[num(*%0)])];}
&cmd-badmin-rem board=$+badmin/rem *:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=Removing...;&list-admins me=[remove(v(list-admins),num(*%0))];}
&cmd-badmin-list board=$+badmin/list:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=[center(Board Admins:,79,=)]%r [iter(get(me/list-admins),[name(##)]%r)][repeat(=,79)];}
&xformat board=[rjust([rest(%1,-)],4)] | [ljust(mid(first(rest(rest(%0,|),|),|),0,37),39)] | [ljust(mid(name(first(%0,|)),0,20),22)] [ljust(mid(first(rest(%0,|),|),0,6),8)]
@@ format is: &post-# board=#author|time|title|body
@@ PUT BOARD OWNER DB# HERE to start with:
&list-admins board=#14302
&text-help board=[center(Bulletin board commands:,79,=)]%r+bhelp --- show this text%r+bscan --- view list of posts%r+bscan/from <#> --- view list of posts, starting at post #%r+bread <#> --- view a post (e.g., +bread 2)%r+bpost <title>=<body of your post>%r+bedit <#>=<old text>/<new text> --- edit one of your posts%r+brem <#> --- remove one of your own posts%r[repeat(-,79)]%r Admin commands:%r+brem/upto <#> --- clear the board up to (and including) post #.%r+badmin/add <player> --- add <player> to the board administrators%r+badmin/rem <player> --- remove <player> from the board administrators%r+badmin/list --- view list of board administrators%r[repeat(=,79)]%rCoded by Tai@DM%r[repeat(=,79)]
to @lock/use the thing. If you're looking for a nice global bulletin
board for your MUSH, I recommend Myrddin's softcoded board. (This does
require wiz privileges to set up.)
Simple bulletin board:
As usual, the lines have been split up for editing purposes.
If you want to use this code, you'll have to splice the lines back
together. You might also want to play with the spacing in
the &xheader and &cmd-read attributes if things don't line up
right on each line.
--- Taisch, 16-December-1999
========================================================================
@create board
@set board=command
@lock board=me
@desc board=This is a bulletin board set up on a convenient wall.
@adesc board=@pemit %#=Type '+bhelp' for commands.
&cmd-help board=$+bhelp:@pemit %#=[u(text-help)]
&cmd-scan board=$+bscan:@pemit %#=[repeat(=,79)]%r[space(5)]Title:[space(34)]Author:[space(17)]Date:%r[repeat(-,79)]%r [iter(sort(lattr(me/post-*),n),[u(xformat,get(me/##),##)]%r)][repeat(-,79)]%r +bread <number> to read a note., +bhelp for more info.%r[repeat(=,79)]
&cmd-scanfrom board=$+bscan/from *:@pemit %#=[repeat(=,79)]%r[space(5)]Title:[space(34)]Author:[space(17)]Date:%r[repeat(-,79)]%r [iter(cat(POST-%0,after(sort(lattr(me/post-*),n),POST-%0)),[u(xformat,get(me/##),##)]%r)][repeat(-,79)]%r +bread <number> to read a note., +bhelp for more info.%r[repeat(=,79)]
&cmd-read board=$+bread *:@pemit %#=[switch(hasattr(me,post-%0),0,No such post,[repeat(=,79)]%r[rjust(%0,4)] | [ljust(mid(first(rest(rest(get(me/post-%0),|),|),|),0,39),40)] | [ljust(mid(name(first(get(me/post-%0),|)),0,20),22)] [ljust(mid(first(rest(get(me/post-%0),|),|),0,6),8)]%r[repeat(-,79)]%r[rest(rest(rest(get(me/post-%0),|),|),|)]%r[repeat(=,79)])]
&cmd-post board=$+bpost *=*:th [setq(0,add(1,last(last(sort(lattr(me/post-*),n)),-)))];&post-[max(1,%q0)] me=%#|[rest(time())]|%0|%1;@pemit %#=You post to the board.
&cmd-edit board=$+bedit *=*/*:@switch %#=[first(get(me/post-%0),|)],{[setq(0,edit(rest(rest(rest(get(me/post-%0),|),|),|),%1,%2))];&post-%0 me=[extract(get(me/post-%0),1,3,|)]|%q0;@pemit %#=Post now reads:%r%q0;},{@pemit %#=You may only edit your own posts.}
&cmd-delete board=$+brem *:@switch %#=[first(get(me/post-%0),|)],{&post-%0 me=;@pemit %#=Post deleted.},{@pemit %#=You may only delete your own posts.}
&cmd-badminclear board=$+brem/upto *:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=Wiping...;@switch [hasattr(me,post-%0)]=0,{@pemit %#=No such post!},{@dolist [cat(POST-%0,before(sort(lattr(me/post-*),n),POST-%0))]=&## me=;}}
&cmd-badmin-add board=$+badmin/add *:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=Adding...;&list-admins me=[setunion(get(me/list-admins),[num(*%0)])];}
&cmd-badmin-rem board=$+badmin/rem *:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=Removing...;&list-admins me=[remove(v(list-admins),num(*%0))];}
&cmd-badmin-list board=$+badmin/list:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=[center(Board Admins:,79,=)]%r [iter(get(me/list-admins),[name(##)]%r)][repeat(=,79)];}
&xformat board=[rjust([rest(%1,-)],4)] | [ljust(mid(first(rest(rest(%0,|),|),|),0,37),39)] | [ljust(mid(name(first(%0,|)),0,20),22)] [ljust(mid(first(rest(%0,|),|),0,6),8)]
@@ format is: &post-# board=#author|time|title|body
@@ PUT BOARD OWNER DB# HERE to start with:
&list-admins board=#14302
&text-help board=[center(Bulletin board commands:,79,=)]%r+bhelp --- show this text%r+bscan --- view list of posts%r+bscan/from <#> --- view list of posts, starting at post #%r+bread <#> --- view a post (e.g., +bread 2)%r+bpost <title>=<body of your post>%r+bedit <#>=<old text>/<new text> --- edit one of your posts%r+brem <#> --- remove one of your own posts%r[repeat(-,79)]%r Admin commands:%r+brem/upto <#> --- clear the board up to (and including) post #.%r+badmin/add <player> --- add <player> to the board administrators%r+badmin/rem <player> --- remove <player> from the board administrators%r+badmin/list --- view list of board administrators%r[repeat(=,79)]%rCoded by Tai@DM%r[repeat(=,79)]