Myra's Menu Object

Example Desc

                               ----- MENU -----                               

                                --- ENTREE ---                                
                                Example entree.                               

                                 --- MAIN ---                                 
                    Wherry on a spit,   Roast sweet tuber.                    

                                --- DESSERT ---                               
                         Redfruit salad,   Lying cake.                        

                                 --- DRINK ---                                
                                 Fruit juice.                                 

                                 --- BOOZE ---                                
                                  White wine.                                 

                               ----- MENU -----                               

Commands:
'+menu <Name>' to view the descriptions of individual items.
     Example: '+menu Redfruit'
'+menu/add <Name>=<Entree|Main|Dessert|Drink|Booze>=<Description>' to add an item - be sure to fill in all fields correctly for it to show on the menu.
     Example: '+menu/add Redfruit=Entree=A ripe and juicy redfruit.'
'+menu/del <Name>=<Entree|Main|Dessert|Drink|Booze>' - only available to the person who originally added the item. If you see something inappropriate or broken, contact Myra.
     Example: '+menu/del Redfruit=Entree'

Item view

--- Example entree --- 
This is an example entree's desc.
Added by Myra.

Code

&CMD-MENU Menu=$+menu *:@pemit %#=--- [capstr(%0)] --- %r[first(u(edit(%0,%b,-)),|)]%rAdded by [name(last(u(edit(%0,%b,-)),|))].

&MENU Menu=[center(----- MENU -----,78)][switch(hasattr(me,entree),1,%r%r[center(--- ENTREE ---,78)]%r[center([edit(edit(u(entree),%b,\\\,%b%b%b),-,%b)].,78)],)][switch(hasattr(me,main),1,%r%r[center(--- MAIN ---,78)]%r[center([edit(edit(u(main),%b,\\\,%b%b%b),-,%b)].,78)],)][switch(hasattr(me,dessert),1,%r%r[center(--- DESSERT ---,78)]%r[center([edit(edit(u(dessert),%b,\\\,%b%b%b),-,%b)].,78)],)][switch(hasattr(me,drink),1,%r%r[center(--- DRINK ---,78)]%r[center([edit(edit(u(drink),%b,\\\,%b%b%b),-,%b)].,78)],)][switch(hasattr(me,booze),1,%r%r[center(--- BOOZE ---,78)]%r[center([edit(edit(u(booze),%b,\\\,%b%b%b),-,%b)].,78)],)]%r%r[center(----- MENU -----,78)]

&CMD-MENU/ADD Menu=$+menu/add *=*=*:@switch [hasattr(me,[edit(%0,%b,-)])]=0,{&[edit(%0,%b,-)] [num(me)]=%2|%#;&%1 [num(me)]=[u(%1)] [edit(%0,%b,-)];@pemit %#=Added. [ansi(g,+menu %0)] to view, [ansi(g,+menu/del %0)] to remove.},1,{@pemit %#=[capstr(%0)] already exists, delete the item or try another name.}

@Desc Menu=[u(menu)]%r%rCommands:%r'[ansi(g,+menu <Name>)]' to view the descriptions of individual items.%r[space(5)]Example: '[ansi(y,+menu Redfruit)]'%r'[ansi(g,+menu/add <Name>=<Entree|Main|Dessert|Drink|Booze>=<Description>)]' to add an item - be sure to fill in all fields correctly for it to show on the menu.%r[space(5)]Example: '[ansi(y,+menu/add Redfruit=Entree=A ripe and juicy redfruit.)]'%r'[ansi(g,+menu/del <Name>=<Entree|Main|Dessert|Drink|Booze>)]' - only available to the person who originally added the item. If you see something inappropriate or broken, contact [name(owner(me))].%r[space(5)]Example: '[ansi(y,+menu/del Redfruit=Entree)]'

&CMD-MENU/DEL Menu=$+menu/del *=*:@switch [last(u(edit(%0,%b,-)),|)]=%#,{@edit [num(me)]/%1=[capstr(edit(%0,%b,-))],;&[edit(%0,%b,-)] me;@pemit %#=Deleted.},@pemit %#=You did not add that.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License