Moderator Assistant

Moderator Assistant allows you to organize a public speaking event, with players requesting to speak, and the management of these speakers handled by this device.

Author: Kyieren@M*U*S*H
Category: Other
Compatibility: CobraMUSH, PennMUSH, TinyBit, TinyMUX.

Instructions

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

MUSHCode for Moderator Assistant

@create Moderator Assistant
@lock Moderator Assistant==me
@set Moderator Assistant = TRUST
@set Moderator Assistant = !NO_COMMAND
&CMD_ADDMOD Moderator Assistant=$addmod *:@switch [strmatch([owner(me)],%#)]=0,{@pemit/silent %#=[ansi(r,You are not the owner. Permission denied.)]},{@switch [setr(0,[pmatch(*%0)])]=-1,{@pemit/silent %#=[ansi(r,That is not a valid player.)]},-2,{@pemit/silent %#=[ansi(r,Which '%0' do you mean?)]},{@switch [t([member([v(moderators)],%q0)])]=1,{@pemit/silent %#=[ansi(r,That person is already on the list of moderators.)]},{&moderators me=[cat([v(moderators)],%q0)];@pemit/silent %#=You add '[name(%q0)]' to the list of moderators.}}}
&CMD_BAN Moderator Assistant=$ban *:@switch [t([member([v(moderators)],%#)])]=0,{@pemit/silent %#=[ansi(r,You are not a moderator. Permission denied.)]},{@switch [setr(0,[pmatch(*%0)])]=-1,{@pemit/silent %#=[ansi(r,That is not a valid player.)]},-2,{@pemit/silent %#=[ansi(r,Which '%0' do you mean?)]},{@switch [t([member([v(moderators)],%q0)])]=1,{@pemit/silent %#=[ansi(r,You may not ban a moderator from the discussion. Permission denied.)]},{@switch [strmatch([owner(me)],%q0)]=1,{@pemit/silent %#=[ansi(r,You may not ban the owner from the discussion. Permission denied.)]},{@switch [t([member([v(banned)],%q0)])]=1,{@pemit/silent %#=[ansi(r,That person is already banned from the discussion.)]},{&banned me=[cat([v(banned)],%q0)];@pemit/silent %#=You ban '[name(%q0)]' from the discussion.;@pemit/silent %q0=[name(%#)] bans you from the discussion.;&waiting me=[remove([v(waiting)],%q0)]}}}}}
&CMD_BANNED Moderator Assistant=$banned:@switch [t([member([v(moderators)],%#)])]=0,{@pemit/silent %#=[ansi(r,You are not a moderator. Permission denied.)]},{@pemit/silent %#=Banned: [itemize([iter([v(banned)],[name(##)])])]}
&CMD_CALL Moderator Assistant=$call *:@switch [t([member([v(moderators)],%#)])]=0,{@pemit/silent %#=[ansi(r,You are not a moderator. Permission denied.)]},{@switch [setr(0,[pmatch(*%0)])]=-1,{@pemit/silent %#=[ansi(r,That is not a valid player.)]},-2,{@pemit/silent %#=[ansi(r,Which '%0' do you mean?)]},{@switch [t([member([lcon(here)],%q0)])]=0,{@pemit/silent %#=[ansi(r,That player is not here.)];&waiting me=[remove([v(waiting)],%q0)]},{@switch [conn(%q0)]=-1,{@pemit/silent %#=[ansi(r,That player is not connected.)];&waiting me=[remove([v(waiting)],%q0)]},{@oemit [v(moderators)]=[name(%#)] says, "I now call [name(%q0)] to speak.";&waiting me=[remove([v(waiting)],%q0)];@pemit/silent/list [v(moderators)]=Moderator: [name(%q0)] is called to speak. [words([v(waiting)])] remaining in queue.;@wait 3=page %q0=Please keep your comments brief, and remember to let us know when you're done.}}}}
&CMD_CANCEL Moderator Assistant=$cancel:@switch [t([member([v(waiting)],%#)])]=0,{@pemit/silent %#=[ansi(r,You have not requested to speak yet.)]},{&waiting me=[remove([v(waiting)],%#)];@pemit/silent %#=You ask to cancel your request to speak, and the assistant erases your name from the list.;@pemit/silent/list [v(moderators)]=MODERATOR: [name(%#)] cancels %p request. [words([v(waiting)])] remaining in queue.}
&CMD_CLEAR Moderator Assistant=$clear:@switch [t([member([v(moderators)],%#)])]=0,{@pemit/silent %#=[ansi(r,You are not a moderator. Permission denied.)]},{@wipe me/waiting;@pemit/silent %#=You clear the request queue.}
&CMD_DELMOD Moderator Assistant=$delmod *:@switch [strmatch([owner(me)],%#)]=0,{@pemit/silent %#=[ansi(r,You are not the owner. Permission denied.)]},{@switch [setr(0,[pmatch(*%0)])]=-1,{@pemit/silent %#=[ansi(r,That is not a valid player.)]},-2,{@pemit/silent %#=[ansi(r,Which '%0' do you mean?)]},{@switch [t([member([v(moderators)],%q0)])]=0,{@pemit/silent %#=[ansi(r,That person is not on the list of moderators.)]},{&moderators me=[remove([v(moderators)],%q0)];@pemit/silent %#=You delete '[name(%q0)]' from the list of moderators.}}}
&CMD_ENFORCE Moderator Assistant=$enforce:@switch [t([member([v(moderators)],%#)])]=0,{@pemit/silent %#=[ansi(r,You are not a moderator. Permission denied.)]},{@switch [strmatch([owner(me)],[owner(%l)])]=0,{@pemit/silent %#=[ansi(r,Unable to enforce, the room's owner and the assistant's owner do not match.)]},{@switch [lock(here/speech)]=*UNLOCKED*,{@oemit %#=The moderator assistant enforces absolute silence.;@pemit/silent/list [v(moderators)]=MODERATOR: [name(%#)] enforces absolute silence.;@lock/speech here=[iter([v(moderators)],*[name(##)]|)][num(me)]},{@pemit/silent %#=[ansi(r,Silence is already enforced here.)]}}
&CMD_MODERATORS Moderator Assistant=$moderators:@pemit/silent %#=Moderators: [itemize([iter([v(moderators)],[name(##)])])]
&CMD_NEXT Moderator Assistant=$next:@switch [t([member([v(moderators)],%#)])]=0,{@pemit/silent %#=[ansi(r,You are not a moderator. Permission denied.)]},{@switch [words([v(waiting)])]=0,{@pemit/silent %#=[ansi(r,There is nobody left in the queue.)]},{@switch [t([member([lcon(here)],[setr(0,[first([v(waiting)])])])])]=0,{page [name(%#)]='[name(%q0)]' is no longer here. Call the next person in the queue.;&waiting me=[remove([v(waiting)],%q0)]},{@switch [conn(%q0)]=-1,{page [name(%#)]='[name(%q0)]' is no longer connected. Call the next person in the queue.;&waiting me=[remove([v(waiting)],%q0)]},{@oemit [v(moderators)]=[name(me)] looks down at %p clipboard and says, "[name(%q0)], you may now speak.";&waiting me=[remove([v(waiting)],%q0)];@pemit/silent/list [v(moderators)]=MODERATOR: [name(%q0)] is called to speak. [words([v(waiting)])] remaining in queue.;@wait 3=page %q0=Please keep your comments brief, and remember to let us know when you're done.}}}}
&CMD_QUEUE Moderator Assistant=$queue:@pemit/silent %#=Queue: [itemize([iter([v(waiting)],[name(##)])])]
&CMD_REQUEST Moderator Assistant=$request:@switch [t([member([v(waiting)],%#)])]=1,{@pemit/silent %#=[ansi(r,You have already submitted a request to speak.)]},{@switch [t([member([v(banned)],%#)])]=1,{@pemit/silent %#=You raise your hand to speak, but the assistant ignores you.},{@switch [words([v(moderators)])]=0,{@pemit/silent %#=[ansi(r,No moderators have been appointed. Permission denied.)]},{&waiting me=[cat([v(waiting)],%#)];@pemit/silent %#=You raise your hand to speak and the assistant nods, writing your name down.;@pemit/silent/list [v(moderators)]=MODERATOR: [name(%#)] joins the queue. [words([v(waiting)])] remaining in queue.}}}
&CMD_RESET Moderator Assistant=$reset:@switch [strmatch([owner(me)],%#)]=0,{@pemit/silent %#=[ansi(r,You are not the owner. Permission denied.)]},{@wipe me/moderators;@wipe me/waiting;@wipe me/banned;@pemit/silent %#=You reset the moderator assistant.}
&CMD_UNBAN Moderator Assistant=$unban *:@switch [t([member([v(moderators)],%#)])]=0,{@pemit/silent %#=[ansi(r,You are not a moderator. Permission denied.)]},{@switch [setr(0,[pmatch(*%0)])]=-1,{@pemit/silent %#=[ansi(r,That is not a valid player.)]},-2,{@pemit/silent %#=[ansi(r,Which '%0' do you mean?)]},{@switch [t([member([v(banned)],%q0)])]=0,{@pemit/silent %#=[ansi(r,That person is not banned from the discussion.)]},{&banned me=[remove([v(banned)],%q0)];@pemit/silent %#=You unban '[name(%q0)]' from the discussion.;@pemit/silent %q0=[name(%#)] unbans you from the discussion.}}}
&CMD_UNENFORCE Moderator Assistant=$unenforce:@switch [t([member([v(moderators)],%#)])]=0,{@pemit/silent %#=[ansi(r,You are not a moderator. Permission denied.)]},{@switch [strmatch([owner(me)],[owner(%l)])]=0,{@pemit/silent %#=[ansi(r,Unable to unenforce, the room's owner and the assistant's owner do not match.)]},{@switch [lock(here/speech)]=*UNLOCKED*,{@pemit/silent %#=[ansi(r,Silence has not been enforced here.)]},{@oemit %#=The moderator assistant unenforces absolute silence.;@pemit/silent/list [v(moderators)]=MODERATOR: [name(%#)] unenforces absolute silence.;@lock/speech here}}}
&CREDITS Moderator Assistant=Kyieren@M*U*S*H (mush.pennmush.org 4201)
&DESCRIBE Moderator Assistant=[switch([t([member([v(moderators)],%#)])][strmatch([owner(me)],%#)],00,{[center(Moderator Assistant Commands,78)]%r[repeat(-,78)]%r[ljust(request,20)]Request to speak%r[ljust(cancel,20)]Cancel your request to speak%r[ljust(moderators,20)]List all moderators%r[ljust(queue,20)]See the list of people waiting to speak},01,{[center(Moderator Assistant Commands,78)]%r[repeat(-,78)]%r[ljust(request,20)]Request to speak%r[ljust(cancel,20)]Cancel your request to speak%r[ljust(moderators,20)]List all moderators%r[ljust(queue,20)]See the list of people waiting to speak%r[ljust(addmod <name>,20)](Owner) Add <name> to moderator list%r[ljust(delmod <name>,20)](Owner) Delete <name> from moderator list%r[ljust(reset,20)](Owner) Reset the moderator assistant},10,{[center(Moderator Assistant Commands,78)]%r[repeat(-,78)]%r[ljust(request,20)]Request to speak%r[ljust(cancel,20)]Cancel your request to speak%r[ljust(moderators,20)]List all moderators%r[ljust(queue,20)]See the list of people waiting to speak%r[ljust(next,20)](Moderator) Call the next person in the queue to speak%r[ljust(call <name>,20)](Moderator) Specifically call <name> to speak%r[ljust(ban <name>,20)](Moderator) Ban <name> from the discussion%r[ljust(unban <name>,20)](Moderator) Unban <name> from the discussion%r[ljust(banned,20)](Moderator) List banned players%r[ljust(clear,20)](Moderator) Clear the list of people waiting to speak%r[ljust(addmod <name>,20)]},{[center(Moderator Assistant Commands,78)]%r[repeat(-,78)]%r[ljust(request,20)]Request to speak%r[ljust(cancel,20)]Cancel your request to speak%r[ljust(moderators,20)]List all moderators%r[ljust(queue,20)]See the list of people waiting to speak%r[ljust(next,20)](Moderator) Call the next person in the queue to speak%r[ljust(call <name>,20)](Moderator) Specifically call <name> to speak%r[ljust(ban <name>,20)](Moderator) Ban <name> from the discussion%r[ljust(unban <name>,20)](Moderator) Unban <name> from the discussion%r[ljust(banned,20)](Moderator) List banned players%r[ljust(clear,20)](Moderator) Clear the list of people waiting to speak%r[ljust(addmod <name>,20)](Owner) Add <name> to moderator list%r[ljust(delmod <name>,20)](Owner) Delete <name> from moderator list%r[ljust(reset,20)](Owner) Reset the moderator assistant})]
@set Moderator Assistant/DESCRIBE=no_command visual public nearby
&LASTPAGED Moderator Assistant=Kyieren
@set Moderator Assistant/LASTPAGED=wizard locked
@set Moderator Assistant=MODERATORS:
@set Moderator Assistant/MODERATORS=no_command
&OTPORT Moderator Assistant=materializes in a [ansi(hb,*shimmering*)] transporter beam.
@set Moderator Assistant/OTPORT=no_command
&OXTPORT Moderator Assistant=dematerializes in a [ansi(hb,*shimmering*)] transporter beam.
@set Moderator Assistant/OXTPORT=no_command
&VERSION Moderator Assistant=1.0 beta
&WAITING Moderator Assistant=
@set Moderator Assistant/WAITING=no_command

addmod %n

look Moderator Assistant