ShadowHawke's Bulletin Board
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for ShadowHawke's Bulletin Board
@create Prototype Bulletin Board
@lock Prototype Bulletin Board==me
@Desc Prototype Bulletin Board=A prototype Bulletin Board. Created by ShadowHawke.%rCommand:%r%t+scan%t%t%tTells you what messages are on the board%r%t+scan <mess>%t%tTells you the comnents of message <mess>%r%t+write <mess>=<test>%tadds a message to the board.%r%t+remove <mess>%t%tRemoves message <mess> if you own it.%r%t+Board Help%t%tHelp on how to use the board.%r%tex Bulletin Board - lets you examine the board to see how it works..:)%renjoy, %rShadowHawke
@set Prototype Bulletin Board/Desc = no_command
@lock/EnterLock Prototype Bulletin Board==me
&LINE Prototype Bulletin Board=-------------------------------------------------------------------------------
&CENTER Prototype Bulletin Board=[mid(v(line),0,add(38,-[div(strlen(%0),2)]))] %0 [mid(v(line),0,add(38,-[div(strlen(%0),2)]))]
&REMOVE Prototype Bulletin Board=$+remove *:@wait me={@switch or(member(owner(%#),first(v(mess-[v(0)]))),elock(me/enter,%#))=1,{@switch gte(v(num-mess),%0)=1,{@dolist after(lnum(add(v(num-mess),1)),sub(%0,1))={&mess-## me=[v(mess-[add(##,1)])]};&num-mess me=[sub(v(num-mess),1)];@wait 0=@pemit %#=message deleted.},{@pemit %#=ERROR, Invalid message number.}},{@pemit %#=ERROR, Authorization refused.}};@notify me
&SCAN Prototype Bulletin Board=$+scan *:@switch or(lt(%0,0),gt(%0,v(num-mess)))=0,{@pemit %#=[u(me/center,Message %0)]%rAuthor: [name(first(v(mess-[v(0)])))]%t%tSubject: [before(after(v(mess-[v(0)]),^^^),```)]%r[v(line)]%r[after(eval(me,mess-[v(0)]),```)]%r[v(line)]},{@pemit %#=Sorry, invalid message.}
&WRITEMES Prototype Bulletin Board=$+write *=*:@wait me={&num-mess me=[add(v(num-mess),1)];&mess-[v(num-mess)] me=%# [time()]^^^[v(0)]```[v(1)];@pemit %#=message added, I think.};@notify me
&BROWSE Prototype Bulletin Board=$+scan:@pemit %#=[u(me/center,Advailable Postings)];@dolist rest(lnum(add(v(num-mess),1)))=@pemit %#=[u(me/tab,##\),4)][u(me/tab,name(first(v(mess-##))),20)][before(rest(v(mess-##)),^^^)][space(2)][before(after(v(mess-##),^^^),```)];@wait 0=@pemit %#=[u(me/center,End of Messages)]
&BHELP Prototype Bulletin Board=$+board help:@pemit %#=[eval(me,desc)]
&MESS-1 Prototype Bulletin Board=#8442 Fri Oct 30 17:30:58 1992^^^Credits```Frosty came up with the idea. ShadowHawke wrote the code, which is probally (not intentionally) slightly like the bullentin board Javelin wrote.
&NUM-MESS Prototype Bulletin Board=1
&TAB Prototype Bulletin Board=[ljust(%0,%1)]
@set Prototype Bulletin Board=COMMANDS
@lock Prototype Bulletin Board==me
@Desc Prototype Bulletin Board=A prototype Bulletin Board. Created by ShadowHawke.%rCommand:%r%t+scan%t%t%tTells you what messages are on the board%r%t+scan <mess>%t%tTells you the comnents of message <mess>%r%t+write <mess>=<test>%tadds a message to the board.%r%t+remove <mess>%t%tRemoves message <mess> if you own it.%r%t+Board Help%t%tHelp on how to use the board.%r%tex Bulletin Board - lets you examine the board to see how it works..:)%renjoy, %rShadowHawke
@set Prototype Bulletin Board/Desc = no_command
@lock/EnterLock Prototype Bulletin Board==me
&LINE Prototype Bulletin Board=-------------------------------------------------------------------------------
&CENTER Prototype Bulletin Board=[mid(v(line),0,add(38,-[div(strlen(%0),2)]))] %0 [mid(v(line),0,add(38,-[div(strlen(%0),2)]))]
&REMOVE Prototype Bulletin Board=$+remove *:@wait me={@switch or(member(owner(%#),first(v(mess-[v(0)]))),elock(me/enter,%#))=1,{@switch gte(v(num-mess),%0)=1,{@dolist after(lnum(add(v(num-mess),1)),sub(%0,1))={&mess-## me=[v(mess-[add(##,1)])]};&num-mess me=[sub(v(num-mess),1)];@wait 0=@pemit %#=message deleted.},{@pemit %#=ERROR, Invalid message number.}},{@pemit %#=ERROR, Authorization refused.}};@notify me
&SCAN Prototype Bulletin Board=$+scan *:@switch or(lt(%0,0),gt(%0,v(num-mess)))=0,{@pemit %#=[u(me/center,Message %0)]%rAuthor: [name(first(v(mess-[v(0)])))]%t%tSubject: [before(after(v(mess-[v(0)]),^^^),```)]%r[v(line)]%r[after(eval(me,mess-[v(0)]),```)]%r[v(line)]},{@pemit %#=Sorry, invalid message.}
&WRITEMES Prototype Bulletin Board=$+write *=*:@wait me={&num-mess me=[add(v(num-mess),1)];&mess-[v(num-mess)] me=%# [time()]^^^[v(0)]```[v(1)];@pemit %#=message added, I think.};@notify me
&BROWSE Prototype Bulletin Board=$+scan:@pemit %#=[u(me/center,Advailable Postings)];@dolist rest(lnum(add(v(num-mess),1)))=@pemit %#=[u(me/tab,##\),4)][u(me/tab,name(first(v(mess-##))),20)][before(rest(v(mess-##)),^^^)][space(2)][before(after(v(mess-##),^^^),```)];@wait 0=@pemit %#=[u(me/center,End of Messages)]
&BHELP Prototype Bulletin Board=$+board help:@pemit %#=[eval(me,desc)]
&MESS-1 Prototype Bulletin Board=#8442 Fri Oct 30 17:30:58 1992^^^Credits```Frosty came up with the idea. ShadowHawke wrote the code, which is probally (not intentionally) slightly like the bullentin board Javelin wrote.
&NUM-MESS Prototype Bulletin Board=1
&TAB Prototype Bulletin Board=[ljust(%0,%1)]
@set Prototype Bulletin Board=COMMANDS